similar to: passing a matrix to C++ with .C()?

Displaying 20 results from an estimated 10000 matches similar to: "passing a matrix to C++ with .C()?"

2008 Apr 13
0
[Fwd: Re: Assigning to multiple variables]
Scott Romans wrote: > If we have a function that returns 2 or more values (such as dim as > applied to a matrix), can we assign these 2 or more values to an equal > number of differently named variables in one line? For example, is > there any way to do something like this: > > [NumberRows NumberColumns] <- dim(MatrixA) In that case R returns an object (a vector) with
2003 Jul 22
3
R and C++ compared with only C++
My computer is a pentium 4 running at 2.4 GHz. My R is 1.7.1 I have written a program in R that calls C++. The program spends most of the time in C++ ( > 90% ). R basically deals with output and input. How slower can this be compared with the program I would get from rewriting everything in C++? Thank you.
2002 Mar 17
5
compute variance of every column in a matrix without a loop
Is it possible to compute the variance of every column in a matrix without a loop? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2004 Jan 30
7
Detect the presence of an object
Is there a function like "is.there" such that is.there ( a ) returns TRUE is object 'a' is in the current environment and FALSE otherwise? Thank you. Francisco J. Molina
2003 Sep 24
1
weird behaviour when calling c++
I am using 1.7.1 in a PC ( redhat 9, linux ) I created a subroutine in C++, mySubrutine, to be used in R. To debug this subroutine I have a main routine in C++ that calls mySubrutine. The only thing main () does is to provide mySubrutine with its arguments (this is the easiest way for me to debug subroutines written in C++ and intended to be used in R ). I also have a version of the same
2003 Apr 22
7
Subject: Eliminate repeated components from a vector X-Mailer: VM 7.00 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid Reply-To: fjmolina at lbl.gov FCC: /home/f/.xemacs/mail/sent Does anyone know how I can eliminate repeated elements from a vector?
2003 Feb 06
2
function 'silhouette' in package 'cluster'
Dear all, I am trying (without much success) to use the fuction 'silhouette'. Would anyone encountered that before (or would know where I am wrong ?) Please find below the R ouput. Thanks in advance, L. > s <- silhouette(ct, as.dist(metric)) Error in "[<-"(*tmp*, iC, "sil_width", value = s.i) : number of items to replace is not a multiple of replacement
2002 Oct 11
2
No subject
Subject: activity of CPU used by R X-Mailer: VM 7.00 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid Reply-To: fjmolina at lbl.gov FCC: ~/mail/sent My R processes never use more than 50% of my CPU activity. Is there any way I can make them use more of it? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2002 Nov 19
4
fast way to check an object is a member of a list?
Is there any fast way to check that an object is a member of a list? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2004 Feb 12
3
How to detect whether a file exists or not?
I would like my program to load variables x,y,x from a file 'myFile.r' but if this file does not exist, I want my program to create/initialize x,y,z. Does anyone know how to do this? Thank you very much. Francisco J. Molina
2016 Apr 19
2
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
Using the Matrix package, how can I create a row-oriented sparse Matrix from scratch populated with some data? By default a column-oriented one is created and I'm aware of the note that the package is optimized for column-oriented ones, but I'm only interested in using it for holding my sparse row-oriented data and doing basic subsetting by rows (even using drop=FALSE). Here is what I
2015 Mar 19
6
RFC: Matrix package: Matrix products (%*%, crossprod, tcrossprod) involving "nsparseMatrix" aka sparse pattern matrices
This is a Request For Comment, also BCCed to 390 package maintainers of reverse dependencies of the Matrix package. Most users and package authors working with our 'Matrix' package will be using it for numerical computations, and so will be using "dMatrix" (d : double precision) matrix objects M, and indirectly, e.g., for M >= c will also use "lMatrix" (l:
2002 Mar 19
5
matrix with fix number columns but variable number rows
I have to store a number of vectors of the same length. I know the length but I do not know the number of vectors. How can I store them as they are created (they are created one by one)? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
2002 Jul 09
2
C++ and R
I am calling C++ from R. I want C++ to return a vector whose length is not known when the C++ routine is called. Is it possible to do this without using R objects in the C++ routine? So far I have been using .C, but I do not see how I could use it in this case. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2007 Jun 04
2
locked environment and inheritance
Hi, I have a S3 package with namespace called "myS3Pkg". Inside my package I would like to create a S4 class which extends (adds 2 slots) another S4 class from some other package. The class should be created in "myPkg" environment (and not global environment). Using: setClass("myS4class", representation("otherS4class", mydata = "numeric"),
2002 Mar 13
3
Error: subscript out of bounds
How can locate in my program an error of that kind (Error: subscript out of bounds)? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2016 Apr 20
0
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com> >>>>> on Tue, 19 Apr 2016 14:04:11 -0700 writes: > Using the Matrix package, how can I create a row-oriented sparse > Matrix from scratch populated with some data? By default a > column-oriented one is created and I'm aware of the note that the > package is optimized for
2002 Nov 18
2
No subject
Subject: Error: cannot allocate vector of size 554 Kb X-Mailer: VM 7.00 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid Reply-To: fjmolina at lbl.gov FCC: ~/mail/sent Does anyone know how I can avoid this error? Error: cannot allocate vector of size 554 Kb I think my computer should have enough memory to allocate such vector.
2002 Jan 18
3
Shared libraries for use with R
I am moving my first steps in writing and compiling C code and calling it from R. (I am also new to shared libraries...) My problem is that my C code uses a C function contained in another library (".a", not ".so" - is that the problem?). This is how I compile the file with the functions I want to call from R: cd /export/home/gpetris/ R SHLIB tryit.c cc
1999 Apr 21
1
source("filename") vs. input from command-line
R-helpers, When I source("tmp.r") a file from within R, the code executes without error. When I launch with 'R --no-save --no-restore < tmp.r', the code sometimes appears to cause some type of buffer overflow and nothing gets executed. tmp.r contains: myData<-c(1,0, ... long vector of numbers) followed by a new line character and then some code to operate on myData. It