Displaying 20 results from an estimated 5000 matches similar to: "C function call in R"
2012 Mar 15
4
replicating C example from the Extensions Manual problem
Dear R People:
Here is something that I am sure is very simple. I'm just trying to
re-create the C convolution example in the Extensions manual. Here is
the subroutine:
void convolve(double *a, int *na, double *b, int *nb, double *ab)
{
R_len_t i, j, nab = *na + *nb - 1;
for(i = 0; i < nab; i++)
ab[i] = 0.0;
for(i = 0; i < *na; i++)
for(j = 0; j < *nb; j++)
ab[i + j] += a[i] *
2010 Apr 30
2
RInside & child threads
Hi Folks,
I am creating a multi-threaded C++ application that initializes RInside in
one of the child thread.
I would also like to access support interfaces like Rcpp::Environment in the
remaining child threads, so that I could access any "R" function associated
with the
environment initialized.
When I run my program, I always get "C Stack limit too huge" errors.
I looked
2008 Feb 11
2
image quality
dear all,
I am writing a sweave documentation for my analysis, and I am plotting huge
scatter plot data for microarray.
unlucly this take a lot of resource to my pc because of the quality of the
image which is to high (I see the PC get stuck for each single spot).
how can I overcome this problem? is there a way to make lighter image?
john
[[alternative HTML version deleted]]
2010 May 29
3
S4 dispatch for .DollarNames (utils)
Hello,
I'm trying to make .DollarNames generic and implement a method for it in
a package. .DollarNames is the function that is now called to get
completion possibilities.
My R code looks like this:
setGeneric( ".DollarNames" )
setClass("track",
representation(x="numeric", y="numeric"))
## A class extending the previous, adding one more
2010 Dec 03
1
Error using Rcpp under windows xp
Hi,
I am a newbie to Rcpp packages, and got problems in having basic set-ups for
Rcpp under windows xp. Here is the list I have done.
1) installed Rtools and have no problem in compiling .c file.
2) installed Rcpp packages
3) set enviroment variables 'path' to make C:\Program
Files\R\R-2.12.0\library\Rcpp\include\ searchable
The sample C++ code I used is from the original website:
2010 Jan 14
1
how to call a function from C
Hi,
In Rcpp, we now have a "Function" class to encapsulate functions (they
cover all three kinds, but this may change).
To call the function, what we do is generate a call with the function as
the first node and then evaluate the call.
SEXP stats = PROTECT( R_FindNamespace( mkString( "stats") ) );
SEXP rnorm = PROTECT( findVarInFrame( stats, install( "rnorm") ) )
2010 Sep 28
1
How to convert SEXP to double
Hello All,
A simple question.
I get some return from the R in my C++ program (via Rcpp package). The
result come, as SEXP and it should be a simple numeric variable.
How to convert it to double?
The code, what i use:
stringstream ss;
ss << "p <- predict(fit_ar11, n.ahead = 2, doplot=FALSE);"
<< "p$pred[1]";
SEXP ans;
int iRet =
2011 Jan 11
1
as.environment.list provides inconsistent results under torture
Hello,
Using R-devel (rev 53950), I get inconsistent results with
as.environment( VECSXP ) when gctorture is on.
Consider:
a <- list( aa = rnorm, bb = runif )
gctorture(TRUE)
as.environment( a )
The last line sometimes produces the correct environment, but sometimes
I get errors. Here are the three situations:
# good
> as.environment( a )
<environment: 0x100b1c978>
# not good
2010 Aug 20
1
Rserve (Anyone?)
REXP has an asBytes() method. Will this capture the output of an R plot
function if a proper graphics device is used? It appears R insists on
sending plot output to a file. Kind of strange since it insists on loading
all your data into memory before it can do anything.
If so then does anyone know what this would be? I prefer png or jpeg.
Example:
c is an RConnection
REXP r =
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 Sep 01
2
Using packages built in linux in windows
Hi,
I built a package in linux and would like to use it in windows. I cant build
the package again in windows because it would miss the necessary libraries
etc(I'm using Rcpp). So I need to generate a binary version and try to
install it in windows. I tried this and I get the error
/cygdrive/RTools/bin/cp: target 'xf->>' is not a directory
Can someone help me with this?
--
2010 Feb 11
2
LinkingTo and C++
Hello,
I've been trying to make LinkingTo work when the package linked to has
c++ code.
I've put dumb packages to illustrate this emails here ;
http://addictedtor.free.fr/misc/linkingto
Package A defines this C++ class:
class A {
public:
A() ;
~A() ;
SEXP hello() ;
} ;
Package B has this function :
SEXP say_hello(){
A a ;
return a.hello() ;
}
headers of package A are copied
2010 Jul 28
1
How get colnames and rownames in Rcpp method?
Hi all,
How get colnames and rownames in Rcpp method?
attecthed file : RGui.exe capture
my work environment :
R version : 2.11.1
OS : WinXP Pro sp3
Thanks and best regards.
Young-Ju, Park
from Korea
[1][rKWLzcpt.zNp8gmPEwGJCA00]
[@from=dllmain&rcpt=r%2Dhelp%40r%2Dproject%2Eorg&msgid=%3C20100728211143%2EH
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 Jan 02
3
R-devel Digest, Vol 83, Issue 2
[Disclaimer: what is below reflects my understanding from reading the R
source, others will correct where deemed necessary]
On 1/2/10 12:00 PM, r-devel-request at r-project.org wrote:
>
> Hello,
>
> We are currently making lots of changes to Rcpp (see the open Rcpp
> mailing list if interested [1] in the details).
>
> We are now using [2] R_PreserveObject and R_ReleaseObject
2011 May 31
1
assignInNamespace and new bindings
Hello,
assignInNamespace refuses to assign an object to a name that is not
already used in the namespace.
Something like this would make it possible:
--- src/library/utils/R/objects.R (revision 56024)
+++ src/library/utils/R/objects.R (working copy)
@@ -252,8 +252,9 @@
stop("environment specified is not a package")
ns <- asNamespace(substring(nm, 9L))
2010 Jul 26
1
problem with building package on CRAN
Dear friends,
I have just gotten a strange error message back from Uwe saying
that the most recent version of psych failed to pass R CMD check for
Windows.
The error message was less than helpful, in that it seems to have
failed when trying to include the Rcpp library, which I do not
directly call. (see below)
"* using log directory
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
2009 Dec 13
1
How to resolve include Rcpp.h problems?
Hi,
I am Linux Ubuntu 9.04 user. I'm using R-2.6.
Actually, I am developing R package for reading/writing 3D images. I needed
to use the R package Rcpp in order to make profit of available C/C++ codes.
My problem is that my C code is not able to include the Rcpp.h
In fact, when I run this command R CMD build rply, I got the following error
message in the file
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