Hello,
I need to create a list and then fill it sequentially by adding components
in a for loop. Here is an example that works:
library(inline)
src <- '
Rcpp::List mylist(2);
for(int i=0; i<2; ++i)
mylist[i] = i;
mylist.names() = CharacterVector::create("a","b");
return mylist;
'
fun <- cxxfunct
> class A {
> public:
> A(int argument) {}
> A(std::string name) {}
> };
>
> Now, given such a class - is there a way to distinguish the two constructors?
> The way I understand the code in the Rcpp module is to allow for different
> constructors with different numbers of arguments, but overloade
On 11 August 2011 at 03:06, Walrus Foolhill wrote:
| Hello,
| I need to create a list and then fill it sequentially by adding components in
a
| for loop. Here is an example that works:
|
| library(inline)
| src <- '
| Rcpp::List mylist(2);
| for(int i=0; i<2; ++i)
| mylist[i] = i;
| mylist.nam
Ok, thanks for your answer, but I wasn't clear enough. So here are more
details of what I want to do.
I have one list named "probes":
probes <- list(chr1=data.frame(name=c("p1","p2"),
start=c(81,95),
end=c(85,100),
stringsAsFactors=FALSE))
I also
Howdy,
On 11 August 2011 at 20:44, Walrus Foolhill wrote:
| Ok, thanks for your answer, but I wasn't clear enough. So here are more
details
| of what I want to do.
|
| I have one list named "probes":
| probes <- list(chr1=data.frame(name=c("p1","p2"),
| start=c(81,95),
|
Hi all,
I've created a package using Rcpp.package.skeleton("pkg",module=TRUE).
If I create a file R/hello_world2.R with the following
show(World)
b <- new(World)
b$greet()
b$set("hello everybody")
b$greet()
rm(b)
then I receive an "execution halted" error when I try to compile the package
using
Ok, I started with smaller examples. I understand more or less how to
manipulate IntegerVectors, but not StringVectors (see below), and thus I
can't even start manipulating a simple list of StringVectors. Even so I
looked at mailing lists, StackOverflow, package pdf, source code on
R-Forge...
The