[Rd] Call R function in C in "optim fashion"

2015-04-16 Thread bstr
I am trying to extend an R package which is totally written in C. I have the following issue: in the C code I want to make a call to an R defined function as optim routine does. Nevertheless, when I try to trace down the main steps in optim, I am (more or less) able to follow the steps in the C sou

Re: [Rd] call r function in c++ application

2014-12-30 Thread Dirk Eddelbuettel
On 30 December 2014 at 16:38, blesson thomas wrote: | hi, | Am a software developer having 4 yr experience in c++.I want to | integrate R environment in my c++ application,please help me to do so. It's been done, and there is an entire framework for you including examples for - standard u

Re: [Rd] call r function in c++ application

2014-12-30 Thread Duncan Murdoch
On 30/12/2014 6:08 AM, blesson thomas wrote: > hi, > Am a software developer having 4 yr experience in c++.I want to > integrate R environment in my c++ application,please help me to do so. > See the Writing R Extensions manual, Chap 8: Linking GUIs and other front-ends to R. Duncan Murdo

[Rd] call r function in c++ application

2014-12-30 Thread blesson thomas
hi, Am a software developer having 4 yr experience in c++.I want to integrate R environment in my c++ application,please help me to do so. thanks®ards blesson [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list http

Re: [Rd] ‘:::’ call

2013-08-29 Thread Duncan Murdoch
On 13-08-28 9:00 PM, Kasper Daniel Hansen wrote: On Wed, Aug 28, 2013 at 3:22 PM, Duncan Murdoch mailto:murdoch.dun...@gmail.com>> wrote: On 28/08/2013 3:06 PM, Kasper Daniel Hansen wrote: My point of view is that if you have a core package where you need access t

Re: [Rd] ‘:::’ call

2013-08-28 Thread Kasper Daniel Hansen
On Wed, Aug 28, 2013 at 3:22 PM, Duncan Murdoch wrote: > On 28/08/2013 3:06 PM, Kasper Daniel Hansen wrote: > >> My point of view is that if you have a core package where you need access >> to "hidden" functions for making a plugin, you should probably export >> these >> hidden functions in the fi

Re: [Rd] ‘:::’ call

2013-08-28 Thread Gabriel Becker
On Wed, Aug 28, 2013 at 4:50 PM, Paul Gilbert wrote: > > (Also, if you export it then you should document it, but for many > maintainers \keyword{internal} is shorthand for I don't need to document > this properly because no one is suppose to use it outside the package.) > But why would somethi

Re: [Rd] ‘:::’ call

2013-08-28 Thread Paul Gilbert
On 13-08-28 05:13 PM, Hadley Wickham wrote: 3/ Some functions are exported normally but hidden by using "." in the beginning of their names. Other package maintainers would know they exist, but end users would not so easily find them. (Duncan's other suggestion of using \keyword{internal} in

Re: [Rd] ':::' call

2013-08-28 Thread Mark.Bravington
+61) 3 6232 5118 fax (+61) 3 6232 5012 mob (+61) 438 315 623 > -Original Message- > From: r-devel-boun...@r-project.org > [mailto:r-devel-boun...@r-project.org] On Behalf Of Duncan Murdoch > Sent: Thursday, 29 August 2013 5:22 AM > To: Kasper Daniel Hansen > Cc: Marc

Re: [Rd] ‘:::’ call

2013-08-28 Thread Hadley Wickham
> 3/ Some functions are exported normally but hidden by using "." in the > beginning of their names. Other package maintainers would know they exist, > but end users would not so easily find them. (Duncan's other suggestion of > using \keyword{internal} in the .Rd file strikes me as problematic. I

Re: [Rd] ‘:::’ call

2013-08-28 Thread Paul Gilbert
I may have confused things by referring to ':::' which everyone reads as not exported, not documented, not part of the API, constantly changing, ... In my mind, the real question is about two levels of exporting, one to other package developers, and another to end users. In both cases they are

Re: [Rd] ‘:::’ call

2013-08-28 Thread Yihui Xie
If this issue is going to be solved at all, it might end up as yet another "hack" like utils::globalVariables just to "fix" R CMD check which was trying to fix things that were not necessarily broken. To be clear, I was not suggesting subvert this check. What I was hoping is a way to tell CRAN tha

Re: [Rd] ‘:::’ call

2013-08-28 Thread Duncan Murdoch
On 28/08/2013 3:06 PM, Kasper Daniel Hansen wrote: My point of view is that if you have a core package where you need access to "hidden" functions for making a plugin, you should probably export these hidden functions in the first place. Chances are that if you need access to these hidden functi

Re: [Rd] ‘:::’ call

2013-08-28 Thread Duncan Murdoch
On 28/08/2013 2:50 PM, Paul Gilbert wrote: On 13-08-28 12:29 PM, Marc Schwartz wrote: > > On Aug 28, 2013, at 11:15 AM, Paul Gilbert wrote: > >> I have a package (TSdbi) which provides end user functions that I export, and several utilities for plugin packages (e.g. TSMySQL) that I do not expor

Re: [Rd] ‘:::’ call

2013-08-28 Thread Kasper Daniel Hansen
My point of view is that if you have a core package where you need access to "hidden" functions for making a plugin, you should probably export these hidden functions in the first place. Chances are that if you need access to these hidden functions (for expert use), other (expert) users might want

Re: [Rd] ‘:::’ call

2013-08-28 Thread Paul Gilbert
On 13-08-28 12:29 PM, Marc Schwartz wrote: On Aug 28, 2013, at 11:15 AM, Paul Gilbert wrote: I have a package (TSdbi) which provides end user functions that I export, and several utilities for plugin packages (e.g. TSMySQL) that I do not export because I do not intend them to be exposed to

Re: [Rd] ‘:::’ call

2013-08-28 Thread Gavin Simpson
Paul, this was discussed at length only a couple of days ago. See this thread: http://comments.gmane.org/gmane.comp.lang.r.devel/34100 If I follow you, I think a change has been made that doesn't NOTE if the use of `:::` is to packages for which you are also the maintainer. But read the thread as

Re: [Rd] ‘:::’ call

2013-08-28 Thread Marc Schwartz
On Aug 28, 2013, at 11:15 AM, Paul Gilbert wrote: > I have a package (TSdbi) which provides end user functions that I export, and > several utilities for plugin packages (e.g. TSMySQL) that I do not export > because I do not intend them to be exposed to end users. I call these from > the plug

[Rd] ‘:::’ call

2013-08-28 Thread Paul Gilbert
I have a package (TSdbi) which provides end user functions that I export, and several utilities for plugin packages (e.g. TSMySQL) that I do not export because I do not intend them to be exposed to end users. I call these from the plugin packages using TSdbi::: but that now produces a note in

Re: [Rd] call R function from C code

2013-05-14 Thread Dirk Eddelbuettel
If you are fine with another package doing the legwork for you, calling an R function from C++ is very easy: R> library(Rcpp) R> cppFunction('NumericVector fun(NumericMatrix X, NumericVector y, Function s) { return s(X, y); }') R> set.seed(42); solve(matrix(rnorm(9),3,3), rep(1,3)) [1] -0.778649

Re: [Rd] call R function from C code

2013-05-11 Thread Radford Neal
> From: "Matwey V. Kornilov" > > the following seems to work just great for me: > > PROTECT(sx = eval(lang3(install("solve"),sA,sb),R_BaseEnv)) You need to PROTECT the result of lang3 before calling eval. And on the other hand, you don't necessarily have to protect the result of eval (only if you

Re: [Rd] call R function from C code

2013-05-10 Thread Matwey V. Kornilov
Thank you all, the following seems to work just great for me: PROTECT(sx = eval(lang3(install("solve"),sA,sb),R_BaseEnv)) __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] call R function from C code

2013-05-10 Thread Simon Urbanek
On May 10, 2013, at 5:34 AM, Matwey V. Kornilov wrote: > > Thanks, It is what I was looking for. But now, I poorly understand > environment conception. My initial C function in invoked from R (in some > environment I suppose), how do I know this env, to provide it to eval()? Or, > may I just m

Re: [Rd] call R function from C code

2013-05-10 Thread Dirk Eddelbuettel
On 10 May 2013 at 13:34, Matwey V. Kornilov wrote: | Thanks, It is what I was looking for. But now, I poorly understand | environment conception. My initial C function in invoked from R (in some | environment I suppose), how do I know this env, to provide it to eval()? | Or, may I just make a c

Re: [Rd] call R function from C code

2013-05-10 Thread Matwey V. Kornilov
Thanks, It is what I was looking for. But now, I poorly understand environment conception. My initial C function in invoked from R (in some environment I suppose), how do I know this env, to provide it to eval()? Or, may I just make a clean env? 10.05.2013 00:13, Gabriel Becker пишет: Matw

Re: [Rd] call R function from C code

2013-05-09 Thread Gabriel Becker
Matwey, There are a number of ways to do this, but it depends on what exactly you want. Do you want to execute a call to an actual R function from within C, or do you want to directly call one of R's internal C functions (which may work but is not future-safe unless it is part of the official API)

Re: [Rd] call R function from C code

2013-05-09 Thread Simon Urbanek
On May 8, 2013, at 2:24 PM, Matwey V. Kornilov wrote: > Hi, > > I am writing C code for R, but in middle of the routine I want to call > solve(A,b) function. What is the right way to solve linear set inside C code? > Is it ok to just invoke La_solve()? > There is no such thing as La_solve().

[Rd] call R function from C code

2013-05-09 Thread Matwey V. Kornilov
Hi, I am writing C code for R, but in middle of the routine I want to call solve(A,b) function. What is the right way to solve linear set inside C code? Is it ok to just invoke La_solve()? __ R-devel@r-project.org mailing list https://stat.ethz.ch/m

Re: [Rd] .Call interface: Use R SEXP as C mutable *char

2013-03-02 Thread Michael Bach
On 3/1/13 11:32 PM, Simon Urbanek wrote: I am trying to do something along the lines of: SEXP test_fun (SEXP filename) { const char *inputfile = translateChar(STRING_ELT(filename, 0)); int abc = some_function(inputfile); ... } The code compiles fine, but I get a warning: "passing argument o

Re: [Rd] .Call interface: Use R SEXP as C mutable *char

2013-03-01 Thread Simon Urbanek
Michael, On Mar 1, 2013, at 4:53 PM, Michael Bach wrote: > Dear R Developers, > > > DISCLAIMER: I am new to package development in R and new to this list. > > I am trying to do something along the lines of: > > SEXP test_fun (SEXP filename) { > > const char *inputfile = translateChar(STRING_

[Rd] .Call interface: Use R SEXP as C mutable *char

2013-03-01 Thread Michael Bach
Dear R Developers, DISCLAIMER: I am new to package development in R and new to this list. I am trying to do something along the lines of: SEXP test_fun (SEXP filename) { const char *inputfile = translateChar(STRING_ELT(filename, 0)); int abc = some_function(inputfile); ... } The code comp

Re: [Rd] Call function only when running via R CMD check?

2012-12-18 Thread Renaud
Many thanks for your replies. I had a quick look at both functions: - CRAN(): it detects timing check from --as-cran. - queryRCmdCheck() allows to detect which part of the check is calling a function (examples, tests?). Both are useful! Would be nice to have a R-base function which can provide a

Re: [Rd] Call function only when running via R CMD check?

2012-12-18 Thread Spencer Graves
Have you considered the CRAN function in "fda"? Spencer On 12/18/2012 4:00 AM, Henrik Bengtsson wrote: Hi Renaud, On Tue, Dec 18, 2012 at 8:44 AM, Renaud Gaujoux wrote: Hi Henrik (and list), I am interested in a similar feature, and would be happy to see the suggestions you got off-line :)

Re: [Rd] Call function only when running via R CMD check?

2012-12-18 Thread Henrik Bengtsson
Hi Renaud, On Tue, Dec 18, 2012 at 8:44 AM, Renaud Gaujoux wrote: > Hi Henrik (and list), > > I am interested in a similar feature, and would be happy to see the > suggestions you got off-line :) > Have you come up with a robust solution, which would work in a variety of > situations (in examples

Re: [Rd] Call function only when running via R CMD check?

2012-12-17 Thread Renaud Gaujoux
Hi Henrik (and list), I am interested in a similar feature, and would be happy to see the suggestions you got off-line :) Have you come up with a robust solution, which would work in a variety of situations (in examples, tests, \Sexpr calls, etc..)? Thank you. Bests, Renaud -- Renaud Gaujoux

Re: [Rd] .Call ref card

2012-03-27 Thread Simon Urbanek
FWIW: I have put the (slightly updated) sheet at http://r.research.att.com/man/R-API-cheat-sheet.pdf Note that it is certainly incomplete - but that is intentional to a) to fit the space constraints and b) to show only the most basic things since we are talking about starting with .Call -- adva

Re: [Rd] .Call ref card

2012-03-27 Thread Simon Urbanek
On Mar 27, 2012, at 12:03 PM, Terry Therneau wrote: > On 03/23/2012 10:58 AM, Simon Urbanek wrote: >> This is my shot at a cheat sheet. >> comments are welcome. >> >> Simon >> >> > I was looking through the cheat sheet. It's nice. There are a few things in > it that I can't find in the docu

Re: [Rd] .Call ref card

2012-03-23 Thread Dirk Eddelbuettel
Awesome. I love the reference card. This will be useful. But I couldn't resist recasting your final "silly" example into a) inline use which I find generally easier than having to do R CMD SHLIB followed by dyn.load() b) a comparison with Rcpp which looks just about the same minus so

Re: [Rd] .Call ref card

2012-03-23 Thread Ramon Diaz-Uriarte
Peter, thanks for the slides. However, I felt like Terry and I think because I am missing the "big picture" that I was somewhat surprised by some of the content and organization (e.g., the detail about character vectors, the usage of the tcltk package as example code). Best, R. On Thu, 22 Mar

Re: [Rd] .Call ref card

2012-03-22 Thread Terry Therneau
On 03/22/2012 11:03 AM, peter dalgaard wrote: Don't know how useful it is any more, but back in the days, I gave this talk in Vienna http://www.ci.tuwien.ac.at/Conferences/useR-2004/Keynotes/Dalgaard.pdf Looking at it now, perhaps it moves a little too quickly into the hairy stuff. On the oth

Re: [Rd] .Call ref card [was Re: R-devel Digest, Vol 109, Issue 22]

2012-03-22 Thread peter dalgaard
Don't know how useful it is any more, but back in the days, I gave this talk in Vienna http://www.ci.tuwien.ac.at/Conferences/useR-2004/Keynotes/Dalgaard.pdf Looking at it now, perhaps it moves a little too quickly into the hairy stuff. On the other hand, those were the things that I had found

[Rd] .Call ref card [was Re: R-devel Digest, Vol 109, Issue 22]

2012-03-22 Thread Ramon Diaz-Uriarte
On Thu, 22 Mar 2012 10:38:55 -0400,Simon Urbanek wrote: > On Mar 22, 2012, at 9:45 AM, Terry Therneau wrote: > > > >> > >>> > strongly disagree. I'm appalled to see that sentence here. > >>> > > >>> > Come on! > >>> > > >> The overhead is significant for any large vector and

Re: [Rd] .Call in R

2011-11-20 Thread Raymond
I agree with Martin that this might not be suitable for a C solution. -- View this message in context: http://r.789695.n4.nabble.com/Call-in-R-tp4080721p4087141.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org ma

Re: [Rd] .Call in R

2011-11-18 Thread Karl Forner
Yes indeed. My mistake. On Fri, Nov 18, 2011 at 4:45 PM, Joris Meys wrote: > Because if you calculate the probability and then make uniform values, > nothing guarantees that the sum of those uniform values actually is > larger than 50,000. You only have 50% chance it is, in fact... > Cheers > Jo

Re: [Rd] .Call in R

2011-11-18 Thread Joris Meys
Because if you calculate the probability and then make uniform values, nothing guarantees that the sum of those uniform values actually is larger than 50,000. You only have 50% chance it is, in fact... Cheers Joris On Fri, Nov 18, 2011 at 4:08 PM, Karl Forner wrote: > Hi, > > A probably very naiv

Re: [Rd] .Call in R

2011-11-18 Thread Martin Morgan
On 11/18/2011 07:08 AM, Karl Forner wrote: Hi, A probably very naive remark, but I believe that the probability of sum( runif(1) )>= 5 is exactly 0.5. So why not just test that, and generate the uniform values only if needed ? My thought as well, but actually the deviates need to have

Re: [Rd] .Call in R

2011-11-18 Thread Karl Forner
Hi, A probably very naive remark, but I believe that the probability of sum( runif(1) ) >= 5 is exactly 0.5. So why not just test that, and generate the uniform values only if needed ? Karl Forner On Thu, Nov 17, 2011 at 6:09 PM, Raymond wrote: > Hi R developers, > >I am new to th

Re: [Rd] .Call in R

2011-11-17 Thread Dirk Eddelbuettel
On 17 November 2011 at 09:09, Raymond wrote: | Hi R developers, | | I am new to this forum and hope someone can help me with .Call in R. | Greatly appreciate any help! | | Say, I have a vector called "vecA" of length 1, I generate a vector | called "vecR" with elements randomly gener

[Rd] .Call in R

2011-11-17 Thread Raymond
Hi R developers, I am new to this forum and hope someone can help me with .Call in R. Greatly appreciate any help! Say, I have a vector called "vecA" of length 1, I generate a vector called "vecR" with elements randomly generated from Uniform[0,1]. Both vecA and vecR are of double typ

Re: [Rd] Call function only when running via R CMD check?

2011-11-03 Thread Henrik Bengtsson
On Wed, Nov 2, 2011 at 7:40 PM, Henrik Bengtsson wrote: > I'd like to be able to change some default settings only in the case > when checking a package with 'R CMD check'.  More precisely, I'd like > to execute a piece of R code before the Rd examples and/or test > scripts are evaluated by 'R CMD

[Rd] Call function only when running via R CMD check?

2011-11-02 Thread Henrik Bengtsson
I'd like to be able to change some default settings only in the case when checking a package with 'R CMD check'. More precisely, I'd like to execute a piece of R code before the Rd examples and/or test scripts are evaluated by 'R CMD check'. Is there a mechanism in 'R CMD check' that makes this p

Re: [Rd] call / do.call expression too big

2011-06-05 Thread Hadley Wickham
On Sun, Jun 5, 2011 at 4:25 PM, Jeroen Ooms wrote: >> argn <- lapply(names(args), as.name) >> names(argn) <- names(args) >> >> call <- as.call(c(list(as.name("lm")), argn)) >> eval(call, args) > > Great, almost! Is there any way I can explicitly specify the package of the > function in this way? I

Re: [Rd] call / do.call expression too big

2011-06-05 Thread Jeroen Ooms
> > argn <- lapply(names(args), as.name) > names(argn) <- names(args) > > call <- as.call(c(list(as.name("lm")), argn)) > eval(call, args) > Great, almost! Is there any way I can explicitly specify the package of the function in this way? I tried replacing "lm" with "stats::lm" but that did not wo

Re: [Rd] call / do.call expression too big

2011-06-04 Thread Hadley Wickham
> I completely understand why this happens, yet I was wondering if there is an > alternative to call/do.call that constructs the call in an different way so > that the actual call object is somewhat more compact and does not contain > all the data that was involved in the function. For example one

Re: [Rd] call / do.call expression too big

2011-06-04 Thread Henrique Dallazuanna
Try this: args <- list(data=quote(cars), formula=dist~speed) On Sat, Jun 4, 2011 at 7:49 PM, Jeroen Ooms wrote: > I am designing a remote procedure protocol for R, which basically performs a > do.call on data and arguments supplied by a client. However, I am > experiencing unfortunate behavior o

[Rd] call / do.call expression too big

2011-06-04 Thread Jeroen Ooms
I am designing a remote procedure protocol for R, which basically performs a do.call on data and arguments supplied by a client. However, I am experiencing unfortunate behavior of the do.call function. The function do.call seems to serialize all objects in the args list, resulting in an enormous ex

Re: [Rd] Call R function from Java

2010-08-08 Thread bytecode
RCaller is another way for calling r from java without JNI. You can try and develop RCaller with GPL license. http://www.mhsatman.com/rcaller -- View this message in context: http://r.789695.n4.nabble.com/Call-R-function-from-Java-tp911738p2317844.html Sent from the R devel mailing list archive

[Rd] Call for suggestions

2010-07-04 Thread michael meyer
Greetings, If this is not the appropriate place to post this question please let me know where to post it. I have a package under development which fits models of the form $$ f(t)=\sum_i B_iG_i(t,\omega) $$ depending on a parameter vector $\omega$ of arbitrary dimension to data (one dimensional t

Re: [Rd] .Call and .C arguments

2010-03-29 Thread Petr Savicky
On Mon, Mar 29, 2010 at 01:56:14PM +0200, Roger Bergande wrote: ... > The passed values are not the same in C. I 'm calling a function in C > with the argument as.double(1204.245) but in the debug mode in C the > value has changed to 1204.2449. I do not see this value printed in the e

Re: [Rd] .Call and .C arguments

2010-03-29 Thread Roger Bergande
Thank you Ducan I'm sorry I wasen't thinking about floating point arithmetic. My problem has nothing to do with the interface. Same rounding in R directly.. Thanks for the hint. Roger __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/li

Re: [Rd] .Call and .C arguments

2010-03-29 Thread Duncan Murdoch
On 29/03/2010 7:56 AM, Roger Bergande wrote: -- Forwarded message -- From: roger.berga...@swisslife.ch Date: Mon, 29 Mar 2010 13:51:12 +0200 Subject: .Call and .C arguments To: berga...@gmail.com Dear List My question is about .C and .Call I was experimenting with the .C an

[Rd] .Call and .C arguments

2010-03-29 Thread Roger Bergande
-- Forwarded message -- From: roger.berga...@swisslife.ch Date: Mon, 29 Mar 2010 13:51:12 +0200 Subject: .Call and .C arguments To: berga...@gmail.com Dear List My question is about .C and .Call I was experimenting with the .C and .Call interface as I came across the followin

Re: [Rd] Call R function from Java

2010-03-17 Thread sara_m
Hi, i would like also to install JRI in Eclipse but it doesnt work.. @way4thesub: can you please tell me how you did that? thanks sara -- View this message in context: http://n4.nabble.com/Call-R-function-from-Java-tp911738p1596298.html Sent from the R devel mailing list archive at Nabble.c

Re: [Rd] Call R from C#

2008-04-08 Thread Richard Cotton
guox wrote: > > I would like to call functions/objects of R from > C#.NET environment. I was wondering whether or not > it is possible. If yes, could you please give me some suggestions > on how to approach it (any examples/documentation on this)? Thanks! > Here are some instructions on callin

Re: [Rd] Call R from C#

2008-03-31 Thread Prof Brian Ripley
On Mon, 31 Mar 2008, [EMAIL PROTECTED] wrote: > I would like to call functions/objects of R from > C#.NET environment. I was wondering whether or not > it is possible. If yes, could you please give me some suggestions > on how to approach it (any examples/documentation on this)? Thanks! Yes, it i

[Rd] Call R from C#

2008-03-31 Thread guox
I would like to call functions/objects of R from C#.NET environment. I was wondering whether or not it is possible. If yes, could you please give me some suggestions on how to approach it (any examples/documentation on this)? Thanks! -James __ R-devel@r-

[Rd] Call for participation: Comparative Methods in R Hackathon

2007-10-03 Thread Steve Kembel
NESCent Hackathon on Comparative Methods in R Call for Participation and Input The R statistical analysis package has emerged as a popular platform for implementation of powerful comparative phylogenetic methods to understand the evolution of organismal traits. The

Re: [Rd] Call C code from R

2007-09-21 Thread christophe vuadens
maybe try this page, http://www.math.ncu.edu.tw/~chenwc/R_note/index.php?item=R_call i'm not alrigth with this but i try Christophe -- View this message in context: http://www.nabble.com/Call-C-code-from-R-tf4463938.html#a12729578 Sent from the R devel mailing list archive at Nabble.com. ___

Re: [Rd] Call C code from R

2007-09-17 Thread Oleg Sklyar
1) You include libraries just like you would always do. Here is the example from my package that uses external libraries of ImageMagick and GTK, standard libraries (stdio, pthread) and R libraries: #include #include #include #include #include #include #include #ifndef WIN32 # include

Re: [Rd] Call C code from R

2007-09-17 Thread Prof Brian Ripley
On Mon, 17 Sep 2007, ? ?. ??? wrote: > Hello, All! > > I'm new for R-devel list. And I'd like to ask some questions, > maybe they will be stuped for the most part of members of the > list. > I need to call function which is written in C++ from R. Your subject line says C > My quest

[Rd] Call C code from R

2007-09-16 Thread Ольга К. Камнева
Hello, All! I'm new for R-devel list. And I'd like to ask some questions, maybe they will be stuped for the most part of members of the list. I need to call function which is written in C++ from R. My questions are: 1. How should I include libraries (for example, iomanip, sstream, iostream)?

Re: [Rd] .Call and to reclaim the memory by allocVector

2007-08-29 Thread Yongchao Ge
Hi Seth, Thank you for the suggestion. Because of using .Call (which does not copy the value) for both parts of my program, there is no extra copy shown by tracemem(). Anyway, the information shown by gc() is very misleading as stated by Prof. Ripley, especially after creating and removing a c

Re: [Rd] .Call and to reclaim the memory by allocVector

2007-08-25 Thread Seth Falcon
Hi Yongchao, Yongchao Ge <[EMAIL PROTECTED]> writes: > Why am I storing a large dataset in the R? My program consist of two > parts. The first part is to get the intermediate results, the computation > of which takes a lot of time. The second part contains many > different functions to manipula

Re: [Rd] .Call and to reclaim the memory by allocVector

2007-08-25 Thread Yongchao Ge
Dear Prof. Ripley I am using 32bit Ubuntu 7.04 on Dual Core Intel Xeon Processor 5140. I do not think that it is the OS's problem in recognizing the memory released by free(), as the Calloc() and Free() pair works perfectly well in my C program. I'm assuming that the free() in your post does no

Re: [Rd] .Call and to reclaim the memory by allocVector

2007-08-24 Thread Prof Brian Ripley
Please do not post to multiple lists! I've removed R-help. You have not told us your OS ('linux', perhaps but what CPU), nor how you know 'the memory was still not reclaimed back to the operating system'. But that is how many OSes work: their malloc maintains a pool of memory pages, and free()

[Rd] .Call and to reclaim the memory by allocVector

2007-08-24 Thread Yongchao Ge
Hi, I am not sure if this is a bug and I apologize if it is something I didn't read carefully in the R extension manual. My initial search on the R help and R devel list archive didn't find useful information. I am using .Call (as written in the R extension manual) for the C code and have foun

[Rd] call R function in c++ program

2007-08-16 Thread Guillaume B.
Hi all I don't know if my message are correct in this forums. I create a program in c++ who use statistical function. I want to execute this function in R (in particular for use packages ade4, lattice, bioconductor...) Until now, my program work for simple function ("plot", "rnorm"...) but I can'

[Rd] call to pt: Warning message: full precision was not achieved in 'pnt' (PR#9171)

2006-08-23 Thread FromeEL
I have followed all instruction in R FAQ Section 9.2 This looks like a bug to me "C:\Program Files\R\R-2.3.1\bin\Rgui.exe" --sdi > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor

Re: [Rd] .Call question

2006-07-26 Thread Thomas Lumley
On Wed, 26 Jul 2006, Rossi, Peter E. wrote: > > Writing R Ext says to treat R objects that are arguments to .Call as > read only (i.e. don't modify). > > I have a long list of lists that and I want to avoid the overhead of a > copy in my C code. I would just like to modify some of the elements >

[Rd] .Call question

2006-07-26 Thread Rossi, Peter E.
Writing R Ext says to treat R objects that are arguments to .Call as read only (i.e. don't modify). I have a long list of lists that and I want to avoid the overhead of a copy in my C code. I would just like to modify some of the elements of list by replacing them with elements of exactly the

Re: [Rd] Call R function from Java

2006-07-13 Thread Simon Urbanek
Adam, [I'm moving this discussion to stat-rosuda-devel, because JRI is strictly speaking a contributed package] On Jul 13, 2006, at 5:28 PM, Adam Kapelner wrote: > It worked. All I had to do is set PATH = < R directory > in my > system variables in "My Computer" and that was it! > > Oh btw S

Re: [Rd] Call R function from Java

2006-07-13 Thread Adam Kapelner
om: Simon Urbanek [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 11:17 AM To: way4thesub Subject: Re: [Rd] Call R function from Java Adam, On Jul 12, 2006, at 10:42 PM, way4thesub wrote: > I am unsure how to actually import JRI into eclipse. I don't know either, but I'd re

Re: [Rd] Call R function from Java

2006-07-12 Thread Prof Brian Ripley
Please do study the posting guide and consult the maintainer (as it asked you to do) with basic information (such as your OS) and the exact messages you received. As a guess: your PATH does not include the R DLLs and needs to? On Wed, 12 Jul 2006, way4thesub wrote: > > Hello, > > I am curren

Re: [Rd] Call R function from Java

2006-07-12 Thread way4thesub
Hello, I am currently attempting to use JRI to call data mining functions in R (ie rpart, lda, etc). I am using Eclipse 3.1.1 and jre1.5.0_06 and jdk1.5.0_07. I am unsure how to actually import JRI into eclipse. I've downloaded the JGR, the rJava and the JRI. I've included the jri.jar file in my

Re: [Rd] Call R function from Java

2006-07-07 Thread Simon Urbanek
On Jul 7, 2006, at 2:05 PM, Vincent Yau wrote: > Simon: > > Would JRI able to also invoke stuff from R packages that I have > installed? > (e.g Bioconductor) > Of course. JRI starts the same R as the RGUI or R console. R is run as one thread in your Java application. Depending on the platfo

Re: [Rd] Call R function from Java

2006-07-07 Thread Vincent Yau
Simon: Would JRI able to also invoke stuff from R packages that I have installed? (e.g Bioconductor) Thanks --v On 7/7/06, Simon Urbanek <[EMAIL PROTECTED]> wrote: > > > On Jul 7, 2006, at 8:50 AM, zana adeb wrote: > > > Dear All, > > > > I need to call R functions from Java, I've read on t

Re: [Rd] Call R function from Java

2006-07-07 Thread Simon Urbanek
On Jul 7, 2006, at 8:50 AM, zana adeb wrote: > Dear All, > > I need to call R functions from Java, I've read on the internet > about JRI but there are no exemples, neither tutorials. There are some basic examples in JRI/examples > I'm beginner in Java and in R, > JRI is a low-level inte

[Rd] Call R function from Java

2006-07-07 Thread zana adeb
Dear All, I need to call R functions from Java, I've read on the internet about JRI but there are no exemples, neither tutorials. I'm beginner in Java and in R, Could you please help me?? Thank you in advance, Xena -

Re: [Rd] .Call and data frames

2006-06-22 Thread Kasper Daniel Hansen
On Jun 22, 2006, at 9:04 AM, Dominick Samperi wrote: > Thanks for the tips, > > This seems to work: > First test for isReal and isInteger. > If they fail, assume character/factor, and > > PROECT(colData = coerceVector(colData,INTSXP); // Not STRSXP > SEXP names = getAttrib(colData, R_LevelsSymbol

Re: [Rd] .Call and data frames

2006-06-22 Thread Dominick Samperi
Thanks for the tips, This seems to work: First test for isReal and isInteger. If they fail, assume character/factor, and PROECT(colData = coerceVector(colData,INTSXP); // Not STRSXP SEXP names = getAttrib(colData, R_LevelsSymbol); // names now contains the string names I was looking for. ds Hin

Re: [Rd] .Call and data frames

2006-06-22 Thread Hin-Tak Leung
Hin-Tak Leung wrote: > I think you want > else if (TYPEOF(colData) == STRSXP) > ... instead. > > I don't know if this will convert from factors to string's, > but somewhere it probably involves something like this: > PROTECT(colData = coerceVector(colData, STRSXP)); FWIW, a factor co

Re: [Rd] .Call and data frames

2006-06-22 Thread Hin-Tak Leung
I think you want else if (TYPEOF(colData) == STRSXP) ... instead. I don't know if this will convert from factors to string's, but somewhere it probably involves something like this: PROTECT(colData = coerceVector(colData, STRSXP)); Dominick Samperi wrote: > Hello, > > I'm trying to

Re: [Rd] .Call and data frames

2006-06-21 Thread Prof Brian Ripley
On Wed, 21 Jun 2006, Kasper Daniel Hansen wrote: > While I do not know how to handle this on the C level, I know that > you do not have characters in data frames, everything is factors > instead. Not so. The default in data.frame() is to convert character vector to factors, but there are many w

Re: [Rd] .Call and data frames

2006-06-21 Thread Kasper Daniel Hansen
While I do not know how to handle this on the C level, I know that you do not have characters in data frames, everything is factors instead. Internally they are coded as a number of integer levels, with the levels having labels (which is the character you see). So eg (in R): > test <- dat

[Rd] .Call and data frames

2006-06-21 Thread Dominick Samperi
Hello, I'm trying to fetch a data frame through the C API, and have no problem doing this when all columns are numbers, but when there is a column of strings I have a problem. On the C-side the function looks like: SEXP myfunc(SEXP df), and it is called with a dataframe from the R side with: .Cal

Re: [Rd] Call R From VC++

2006-06-08 Thread TB
Shilpi, shilpi harpavat wrote: > I want to write an independent C++ application that > can call any R functions and output it as an > c++object. > I tried to use The documentation for Linking R DLL > with VC++ But with no success. > When I link R.dll it says Invalid or

[Rd] Call R From VC++

2006-06-06 Thread shilpi harpavat
Hi, I want to write an independent C++ application that can call any R functions and output it as an c++object. I tried to use The documentation for Linking R DLL with VC++ But with no success. When I link R.dll it says Invalid or corrupt file Any help greatly aprrciated. Thanks Shilpi ___

Re: [Rd] Call trellis function in a function (PR#8827)

2006-05-02 Thread Roger Bivand
On Tue, 2 May 2006 [EMAIL PROTECTED] wrote: This is a FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f > Full_Name: Fan > Version: 2.2.1 > OS: Windows > Submission from: (NULL) (159.50.101.9) > > > Hello, > > When I call trellis function (suc

[Rd] Call trellis function in a function (PR#8827)

2006-05-02 Thread xiao . gang . fan1
Full_Name: Fan Version: 2.2.1 OS: Windows Submission from: (NULL) (159.50.101.9) Hello, When I call trellis function (such as histogram, densityplot, etc.) in a function, the call seems being ignored (no graphics is drawing) if some other instructions are placed afeter that call. Here's an ex

Re: [Rd] .Call not counting parameters consistently (PR#8450)

2005-12-28 Thread Duncan Murdoch
On 12/28/2005 3:01 PM, Duncan Temple Lang wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Coincidentally, I am in the process of working on a related aspect of > symbol resolution. > > The issue is likely to be the caching of native symbols > that we do. We do not cache the registrat

  1   2   >