Skip to content

Commit c2ed340

Browse files
author
Zhuoer Dong
authored
Named[] should be Named() in quick intro vignette
> Rcpp::evalCpp('NumericVector::create(Named["foo"] = 1.0,_["bar"] = 2.0 )') file419870ee27e6.cpp: In function ‘SEXPREC* get_value()’: file419870ee27e6.cpp:6:65: error: invalid types ‘<unresolved overloaded function type>[const char [4]]’ for array subscript SEXP get_value(){ return wrap( NumericVector::create(Named["foo"] = 1.0,_["bar"] = 2.0 ) ) ; } ^ make: *** [file419870ee27e6.o] Error 1 g++ -I"/usr/share/R/include" -DNDEBUG -I"/home/zhuoer/.local/lib/R/Rcpp/include" -I"/tmp/Rtmp7XEiDX/sourceCpp-x86_64-pc-linux-gnu-1.0.0" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-oUvOgu/r-base-3.5.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c file419870ee27e6.cpp -o file419870ee27e6.o /usr/lib/R/etc/Makeconf:168: recipe for target 'file419870ee27e6.o' failed Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, : Error 1 occurred building shared library. > Rcpp::evalCpp('NumericVector::create(Named("foo") = 1.0,_["bar"] = 2.0 )') foo bar 1 2
1 parent 0664c1a commit c2ed340

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vignettes/Rcpp-quickref.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ NumericVector xx(y.begin(), y.end());
111111
NumericVector xx =
112112
NumericVector::create(1.0, 2.0, 3.0, 4.0);
113113
NumericVector yy =
114-
NumericVector::create(Named["foo"] = 1.0,
114+
NumericVector::create(Named("foo") = 1.0,
115115
_["bar"] = 2.0);
116116
// _ short for Named
117117
```

0 commit comments

Comments
 (0)