Displaying 2 results from an estimated 2 matches for "partial_sort".
2009 Jun 04
3
Fast way of finding top-n values of a long vector
If x is a (long) vector and n << length(x), what is a fast way of
finding the top-n values of x?
Some suggestions (calculating the ratio of the two top values):
library("rbenchmark")
set.seed(1); x <- runif(1e6, max=1e7); x[1] <- NA;
benchmark(
replications=20,
columns=c("test","elapsed"),
order="elapsed"
, sort = {a<-sort(x,
2023 Sep 02
1
Fails to install Rfast package
...orks/R.framework/Resources/include" -DNDEBUG
-I../inst/include
-I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Rcpp/include'
-I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppArmadillo/include'
-I/usr/local/include -fPIC -Wall -g -O2 -c partial_sort.cpp -o
partial_sort.o
In file included from partial_sort.cpp:3:
In file included from
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppArmadillo/include/RcppArmadillo.h:29:
In file included from
/Library/Frameworks/R.framework/Versions/4.2/Resources/library/RcppArmadillo/includ...