Displaying 20 results from an estimated 20000 matches similar to: "pass a vector to C++"
2009 Aug 05
4
A question regarding R scoping
I have a question related to scoping. Suppose we have 2 functions:
f1 = function(i){i = 1}
f2 = function(n){
i = length(n)
f1(i)
}
In other words, I would like i=1 regardless of n. Is this possible without having f1 in the body of f2? Thanks in advance!
2009 Jun 24
3
List subsetting
Hello,
I have a question about list indexing. Lets say we have a list of 3 lists, each containing 3 different type elements:
> a=replicate(3, list(list(c(1,1,1), diag(3), c(2,2,2))))
> a
[[1]]
[[1]][[1]]
[1] 1 1 1
[[1]][[2]]
[,1] [,2] [,3]
[1,] 1 0 0
[2,] 0 1 0
[3,] 0 0 1
[[1]][[3]]
[1] 2 2 2
[[2]]
[[2]][[1]]
[1] 1 1 1
[[2]][[2]]
[,1] [,2] [,3]
2010 Jan 08
4
fast lm se?
dear R experts---I am using the coef() function to pick off the coefficients
from an lm() object. alas, I also need the standard errors and I need them
fast. I know I can do a "summary()" on the object and pick them off this
way, but this computes other stuff I do not need. Or, I can compute (X'
X)^(-1) s^2 myself. Has someone written a fast se() function?
incidentally, I think
2011 Feb 06
5
Help with integrating R and c/c++
Hi,
I have been using R for close to two years now and have grown quite
comfortable with the language. I am presently trying to implement an
optimization routine in R (Newton Rhapson). I have some R functions that
calculate the gradient and hessian (pre requisite matrices) fairly
efficiently. Now, I have to call this function iteratively until some
convergance criterion is reached. I think the
2017 Dec 03
2
Rcpp, dyn.load and C++ problems
On 3 December 2017 at 05:23, Eric Berger <ericjberger at gmail.com> wrote:
>
> Do a search on "Rcpp calling C++ functions from R"
>
Thanks. However search for "Rcpp calling C++ functions from R" gives a lot
of result but I think
some of them are outdated and others don't agree with each other.
Can you point to a specific good on-line guide for me?
Regards
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
I would go to the source, in this case Dirk Eddelbuettel's (I hope I
spelled it correctly) documentation for Rcpp:
http://dirk.eddelbuettel.com/code/rcpp/Rcpp-attributes.pdf
Note that you need to do
sourceCpp("logistic_map.cpp")
in R instead of building and dyn.load()-ing the object.
HTH,
Peter
On Sun, Dec 3, 2017 at 11:04 AM, Martin M?ller Skarbiniks Pedersen
<traxplayer
2017 Dec 03
1
Rcpp, dyn.load and C++ problems
On 3 December 2017 at 20:19, Dirk Eddelbuettel <edd at debian.org> wrote:
Hi Dirk,
Thanks for your answers. I got a few more questions.
>
> 0) Wrong list. Rcpp has its down, rcpp-devel, and I basically do not read
> this and would have missed this were it not for luck.
OK. I did found the rcpp-devel mailing-list.
But I though it was a developers of the rcpp-package.
So it is ok
2015 Feb 21
1
RStudio Calling C++ Visual Studio DLL
All,
I'm a newbie to R and I am interested
in seeing a simple example of calling a 3rd party Visual Studio generated DLL
from RStudio. Does anyone have a simple example which also walks through the
preliminary steps of setting up the INCLUDE path and the library path to either
a DLL or LIB file ? I have tried to find an easy example, but thus far had no
luck finding an example using Rcpp
2008 May 26
2
RcppTemplate find example C++ souce code without Rtools ??
Dear R users,
I would like to call R from C++ and Rcpp class library already compiled are
a big advantage !!
I have already read the doc/PDF in the installed package 5.0 and all the
posts in this forum
It's possible to get the source code (RcppExample.cpp) whitout Rtools ??
(i'm not familiar whit Rtools)
many thanks in advance
Roberto Iacopetti
win XP sp 2.2600
Dev-C++ 4.9.9.2
R
2017 Dec 03
5
Rcpp, dyn.load and C++ problems
Hi,
I have written a small C++ function and compile it.
However in R I can't see the function I have defined in C++.
I have read some web-pages about Rcpp and C++ but it is a bit confusion
for me.
Anyway,
This is the C++-code:
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List compute_values_cpp(int totalPoints = 1e5, double angle_increment =
0.01, int radius =
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
2011 Mar 06
1
Plot and curve inside C++
Dear All,
I would like to use
- plot,
- curve
inside a C++ program. What R package do you recommend? Rcpp?
Thanks in advance,
Paul
2015 Jan 31
2
invoking R function in C++ in parallel
Hello,
I'm writing an R extension in C++. In the extension, I want to invoke
an R function directly and it works when I use Rcpp in the serial
code. But what I really want is to invoke the R function in parallel
with openmp. When I do so, I got segmentation fault.
I remember someone said that R isn't thread-safe. I think it's also
understandable because an R function also has
2016 Jan 10
3
coerce SEXP type to C++ matrix class and back
Dear all,
I am testing a simple C++ function that takes a double matrix as
argument and which uses routines provided by the C++ Armadillo
package. I am aware of the nice capabilities of Rcpp and RcppArmadillo
which helps simplifying a lot and that I have already successfully
tested. However, I had a hard time trying to figure out how the
coercion from a REALSPX matrix to an arma::mat =
2011 Jan 26
2
Dealing with R list objects in C/C++
Hi,
I'd like to construct an R list object in C++, fill it with relevant data, and pass it to an R function which will return a different list object back. I have browsed through all the R manuals, and examples under tests/Embedding, but can't figure out the correct way. Below is my code snippet:
#include <Rinternals.h>
// Rf_initEmbeddedR and other setups already performed
2013 Oct 21
4
About integrating R inside a C++ software
Hi,
We are a company developing a software mainly in C++.
We want to integrate R inside our software in order to use mainly the
engine (usual stats as mean, sigma, Pearson, outlier detection, CPA,
multivariate, ...) and probably later the chart solution.
Of course we don''t want to temporary write the data to some csv files
and then do an ugly system() call :
2013 Oct 21
4
About integrating R inside a C++ software
Hi,
We are a company developing a software mainly in C++.
We want to integrate R inside our software in order to use mainly the
engine (usual stats as mean, sigma, Pearson, outlier detection, CPA,
multivariate, ...) and probably later the chart solution.
Of course we don''t want to temporary write the data to some csv files
and then do an ugly system() call :
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
Martin,
You are making your life way too complicated.
There are a number of things I would do differently:
0) Wrong list. Rcpp has its down, rcpp-devel, and I basically do not read
this and would have missed this were it not for luck.
On 3 December 2017 at 02:06, Martin M?ller Skarbiniks Pedersen wrote:
| I have read some web-pages about Rcpp and C++ but it is a bit confusion
| for me.
1)
2009 Feb 12
2
r and c++
Hi all,
is there a way to integrate R language within a c++ programme? That is,
is there something like an R library I can incorporate in my c++ code?
Thanks,
Javier
2015 Mar 02
3
R-devel does not update the C++ returned variables
On 2 March 2015 at 09:09, Duncan Murdoch wrote:
| I generally recommend that people use Rcpp, which hides a lot of the
| details. It will generate your .Call calls for you, and generate the
| C++ code that receives them; you just need to think about the real
| problem, not the interface. It has its own learning curve, but I think
| it is easier than using the low-level code that you need to