Displaying 20 results from an estimated 1100 matches similar to: "Rcpp, dyn.load and C++ problems"
2017 Dec 03
0
Rcpp, dyn.load and C++ problems
.Call("compute_values_cpp")
Also, if you were passing arguments to the C++ function you would need to
declare the function differently.
Do a search on "Rcpp calling C++ functions from R"
HTH,
Eric
On Sun, Dec 3, 2017 at 3:06 AM, Martin M?ller Skarbiniks Pedersen <
traxplayer at gmail.com> wrote:
> Hi,
>
> I have written a small C++ function and compile it.
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)
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
2006 Jun 03
6
Calculating row COUNTs
hi everyone,
I''m trying to do a simple calculation in my rails project. I would like
to find all rows in a table that match the given id of another table
(ie. comment_id) and has the value = 1 ("value" is a field in the
table), then add those values up. Next find the same rows with the
value = -1 and add those values up also. Finally, I would like to find
the total.
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
2013 May 14
2
invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ with Rcpp.
Dear R-Developers,
I just started learning how to use Rcpp. Earlier while using it, I
encountered an error as shown below:
file74d8254b96d4.cpp: In function ‘Rcpp::NumericVector
foo(Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::NumericVector,
Rcpp::Function, Rcpp::Function)’:
file74d8254b96d4.cpp:10: error: invalid operands of types ‘SEXPREC*’ and
‘R_len_t’ to binary ‘operator/’
make: ***
2015 Mar 02
3
R-devel does not update the C++ returned variables
On 03/02/2015 04:37 PM, Martin Maechler wrote:
>
>> 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
2015 Nov 03
1
Fwd: Rcpp sugar dpois
Hi. Here is a piece of cpp code.
It works, but I do not understand the rational for the use of
"R::dpois" to call the function dpois since in the examples I have always
found directly "dpois" or "Rcpp::dpois" that both do not work in my code.
Could anyone be so patient to explain me why should it be like that?
Thaks a lot, Enrico
#include <Rcpp.h>
using
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
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
2013 May 24
0
Rcpp with OpenMP - Need example Makevars
Dear R experts,
recently I started developing a Rcpp package "OpenMPTest".
Within that package I want to use OpenMP, as in the following code example:
// header file
#include <omp.h>
using namespace Rcpp ;
RcppExport SEXP testOpenMP( SEXP nThreads ) ;
// cpp file
SEXP testOpenMP( SEXP nThreads ) {
BEGIN_RCPP
NumericVector numberThreads = NumericVector( nThreads );
2004 Sep 29
2
Approximate a f(x,y)
Hi all,
Running simulations, I'm generating market response to 2 factors X&Y..
There is no closed form for the market response.. The results are store in a
matrix Z(X <- seq(.02,.98,.02), Y <- seq(.01,.19,.01))..
For optmization purpose I need to approximate the values for any factor X in
0,02-0,98 and Y in 0,01-0,19
How can I do it ?
For one factor : Xn-1 < x <= Xn
2011 Dec 13
1
Rcpp too good to be true?
Hello all,
I've been working on a package to do various things related to the
Conway-Maxwell-Poisson distribution and wanted to be able to make fast
random draws from the distribution. My R code was running quite slow so I
decided to give Rcpp a bash. I had used it before but only for extremely
basic stuff and always using inline. This time I decided to give making a
proper package a go.
2004 Apr 07
1
eigenvalues for a sparse matrix
Hi,
I have the following problem. It has two parts.
1. I need to calculate the stationary probabilities of a Markov chain,
eg if the transition matrix is P, I need x such that
xP = x
in other words, the left eigenvectors of P which have an eigenvalue of
one.
Currently I am using eigen(t(P)) and then pick out the vectors I need.
However, this seems to be an overkill (I only need a single
2003 Apr 02
8
lm with an arbitrary number of terms
Hello folks,
Any ideas how to do this?
data.frame is a data frame with column names "x1",...,"xn"
y is a response variable of length dim(data.frame)[1]
I want to write a function
function(y, data.frame){
lm(y~x1+...+xn)
}
This would be easy if n was always the same.
If n is arbitrary how could I feed the x1+...+xn terms into lm(response~terms)?
Thanks
Richard
--
Dr.
2011 Mar 25
4
read.xls -> rotate data.frame
Hi to all,
how could I to rotate automatically a data sheet which was imported by
read.xls?
x1 x2 x3 .... xn
y1 1 4 7 ... xn/y1
y2 2 5 8 .... xn/y2
y3 3 6 9 ....xn/y2
yn ... ... ... Xn/Yn
to
y1 y2 y3 .... yn
x1 1 2 3 ..... Yn/x1
x2 4 5 6 .... Yn/x2
x3 7 8 9 .... Yn/x2
xn ... ... ... ..... Yn/xn
Kind regards Knut
2004 Nov 03
3
fold right - recursive list (vector) operators
The programming language mosml comes with foldr that 'accumulates' a
function f over a list [x1,x2,...,xn] with initial value b as follows
foldr f b [x1,x2,...,xn] = f(x1,...,f(xn-1,f(xn,b))...)
Observe that "list" should have same elements so in R terminology it would
perhaps be appropriate to say that the accumulation takes place over a
'vector'.
I wonder if R
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:
2004 Jul 19
10
How to compare X1 = X2 = ... = Xn?
Dear All,
I have a data frame with n columns: X1, X2, ., Xn. Now I want to create a
new column: if X1 = X2 = . = Xn, the value is 1; Otherwise, the value is 0.
How to do that in a quick way instead of doing (n choose 2) comparisons?
Thank you,
Frank
[[alternative HTML version deleted]]
2011 Apr 15
1
[Rcpp-devel] Find number of elements less than some number: Elegant/fastsolution needed
On Thu, Apr 14, 2011 at 7:02 PM,
<rcpp-devel-request at r-forge.wu-wien.ac.at> wrote:
> I was able to write a very short C++ function using the Rcpp package
> that provided about a 1000-fold increase in speed relative to the best
> I could do in R. ?I don't have the script on this computer so I will
> post it tomorrow when I am back on the computer at the office.
>
>