Reputation: 10499
In R
I can write:
l <- list(a=0, b="10");
And get the value of the element of the list named b
as follow:
x <– l$b
Is there a way to get the same result by using an Rcpp::List
object?
Upvotes: 5
Views: 192
Reputation: 368399
Of course, and there are plenty of examples. Just use
std::string x = l["b"];
where l
is the Rcpp::List
object which is assumed to have names.
Upvotes: 5