Displaying 20 results from an estimated 900 matches similar to: "RInside & child threads"
2010 Mar 22
3
Embed R code in C++
Hi,
Can anyone tell me how to embed R code in a C++ file.
I am actually using a mac running on the OSX 10.6.2 and the IDE Xcode
Version 3.2 and I would like to embed the basic function like geometric,
binomial, normal and hyper geometric distributions in a sample cpp file.
I heard about the library RInside and i have downloaded the source code for
mac but i do not know how to build it in
2010 May 08
1
Error in RImageJ
Hello everybody,
I'm running R under Mac OS 10.6.3 on a MacBook 2.16 GHz Intel Core 2 Duo. I've recently installed R 2.11.0 and the RImageJ library v. 0.1-142. When trying to follow the example given in the package manual and I get the following error:
download.file( "http://www.google.fr/intl/en_en/images/logo.gif", dest = "google.gif" )
trying URL
2010 Apr 22
2
RUnit bug?
There appears to be a bug in RUnit.
Given a testsuite testsuite.math, say, when I run:
runTestSuite(testsuite.math)
this works fine, provided there are no extraneous files in the
unit test subdirectory.
But if there are any Emacs temp files (with names that
end with '~') then runTestSuite gets confused and tries to
run functions from the temp files as well.
[[alternative HTML version
2010 Apr 27
2
Resolving functions using R's namespace mechanism can double runtime
It appears that the runtime for an R script can more than double if a few
references to a function foo() are replaced by more explict references
of the form pkgname::foo().
The more explicit references are of course required when two
loaded packages define the same function.
I can understand why use of this mechanism is not free in an
interpreted environment like R, but the cost seems rather
2010 Apr 28
2
JRI API: sourcing from Java String
Hi all,
I have been using 'source(filename)' to load R code from a file
object. However, now I have a special case where I don't have a file
since I am loading an R script from a Jar file. I would like to avoid
creating temporary files. Is there a way to use the 'source' command
with a Java String? Are there any other, better ways to do that?
Ralf
2010 May 11
2
make: Nothing to be done for `all'.
Hi,
I just bought new macbook pro 10.6.3. I am trying to use some old c code
that used to work. I tried to recompile the code. In the directory with
code I used R CMD SHLIB hello.c and get the error
make: Nothing to be done for `all'.
I have tried reinstalling Xcode and R but I am still having this problem.
Any suggestions?
--
View this message in context:
2010 Mar 07
1
duplicate STRSXP : shallow copy ?
Hello,
As this little program illustrates, duplicating a STRSXP does not seem
deep enough.
require( inline )
fx <- cfunction( signature( x = "character"), '
SEXP y = PROTECT( duplicate( x ) );
int n = LENGTH(x);
int nc = 0 ;
char* p = 0 ;
for( int i=0; i<n; i++){
p = (char*)( CHAR( STRING_ELT( y , i ) ) );
nc = strlen( p ) ;
for( int j=0; j<nc; j++){
p[j] =
2010 Apr 13
3
Inline Package: void vs return type functions
Dear all,
After having a look at the "inline" package and also going through the
"Rcpp" package which is tighty related to it, it came to me this question:
1) my C/ C++ code has a return type (let say a double[][] or a user define
class)
2) I am working with an extensive library built by someone else and I don't
have the time/knowledge to change it by means of working
2010 Mar 18
1
Creating Rcpp RcppDatetime from string with millisecond
Hi,
I was trying to generate RcppDatetime from a string. The main problem
for me is that my string contains millisecond. I saw that RcppDatetime
takes in double of seconds since epoch. I try to generate a double
using boost but has no success. I'm wondering if you have any sample
snippet?
The string looks like:
"2010-03-18 15:50:51.232"
Secondly, what time zone RcppDatetime is
2010 Feb 20
1
how to create a SEXP which could be accessed in embedded R
Hi all,
I am not familiar with writing R extensions. In a C program, I want to create a SEXP and access it in embedded R. How to let the embedded engine know there's a new vector? For example, after creating a SEXP, parsing 'ls()' in embedded R and then evaluating, STRSXP returned will contain the name of the SEXP. Any help would be appreciated.
Regards,
Spiral
[[alternative HTML
2010 Mar 03
1
Mentor for GSOC '10: Symbolic Regression in R
Hi all,
I am looking to extend the regression and data analysis capabilities of R
through Symbolic Regression that can potentially find implicit equation
relationships in the input data. You can find my project proposal at:
http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2010:syrfr
I am looking for a mentor to guide me through the summer on the project
under the Google Summer Of
2010 Mar 30
2
Trouble in using rJava
Hello,
I'm using rJava and JRI to call R scripts from my Java code, but my
scripts are sometimes executed, and very often they don't run throwing a
Java exception.
I'm using a 2.7 version of R, with rJava 0.8.4 and Java Sun 1.6.
Somebody can help me please ??
Thank you very much,
Nabila
2010 Mar 02
1
Double Colors in Main
Dear All,
Consider the following trivial code snippet
rm(list=ls())
name_vec <- c("color1", "color2")
pdf("test_color.pdf")
plot(seq(5), seq(5), main=paste(name_vec[1]," and ",name_vec[2], sep=""))
dev.off()
What I would like to achieve is rather simple to explain, but it is
giving me a headache: how can I have two colors in main? Let us
2010 Apr 21
2
suggestion how to use memcpy in duplicate.c
>From copyVector in duplicate.c :
void copyVector(SEXP s, SEXP t)
{
int i, ns, nt;
nt = LENGTH(t);
ns = LENGTH(s);
switch (TYPEOF(s)) {
...
case INTSXP:
for (i = 0; i < ns; i++)
INTEGER(s)[i] = INTEGER(t)[i % nt];
break;
...
could that be replaced with :
case INTSXP:
for (i=0; i<ns/nt; i++)
memcpy((char *)DATAPTR(s)+i*nt*sizeof(int),
2010 Apr 29
2
Split a vector by NA's - is there a better solution then a loop ?
Hi all,
I would like to have a function like this:
split.vec.by.NA <- function(x)
That takes a vector like this:
x <- c(2,1,2,NA,1,1,2,NA,4,5,2,3)
And returns a list of length of 3, each element of the list is the relevant
segmented vector, like this:
$`1`
[1] 2 1 2
$`2`
[1] 1 1 2
$`3`
[1] 4 5 2 3
I found how to do it with a loop, but wondered if there is some smarter
(vectorized) way
2010 Mar 19
1
Can't setup rJava under ubuntu
When I try to install rJava, I get the following error:
> install.packages('rJava')
...
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags :
2010 Mar 25
1
Error using Rcpp
Hi, Im not sure if this is the right place to post this. I am using Xubuntu
Karmic Koala and am trying to use the Rcpp package. I am testing it using a
simple code that takes in a vector and adds 1 to each element:
#include <Rcpp.h>
// This file takes in a vector and adds one to each entry
RcppExport SEXP addone(SEXP vec){
// create a local copy of vec
Rcpp::NumericVector
2010 Apr 17
1
Error message when trying to install Rcmdr
I am trying to install Rcmdr on my ubuntu machine, but keep getting the
following error messages:
ERROR: failed to lock directory
?/home/thedoctor/R/i486-pc-linux-gnu-library/2.10? for modifying
Try removing ?/home/thedoctor/R/i486-pc-linux-gnu-library/2.10/00LOCK?
ERROR: failed to lock directory
?/home/thedoctor/R/i486-pc-linux-gnu-library/2.10? for modifying
Try removing
2015 Dec 11
1
Runtime error when run a RInside program compiled by intel c++ on windows
I have intstalled R-3.2.2,Rcpp-0.12.2,RInside-0.2.13 on windows. I compiled the example1 of RInside in the
example directory which create a RInside instance and prints "hello world". The compiler is intel c++. I included
the RInside source files in the project and fixed the compile and link errors. But when run the executable file it
prints some error message and quites.
I debug
2012 Dec 05
1
RInside, rcpp compilation problem
I have spent some hours browsing the RInside and rcpp documentation, lots of it; but ... as a programmer of C++ since 1990, on both Windows and Unix ... ( Solaris and Ubuntu, and Mandrake/Mandrivo Linux); I see a minor problem ...... Where is the rcpp.h header file?? The below code fails to compile as the RInside.h header file references the rcpp.h header file, which is not included with