Last active
November 6, 2018 18:56
-
-
Save knapply/a4d985c8e9f41ec34310d873cf12305b to your computer and use it in GitHub Desktop.
Cpp: length built-in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Rcpp.h> | |
using namespace Rcpp; | |
// [[Rcpp::export]] | |
int cpp_size(NumericVector x) { | |
return x.size(); | |
} | |
/*** R | |
cpp_size(1:20) | |
#> [1] 20 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment