similar to: help with rchk warnings on Rf_eval(Rf_lang2(...))

Displaying 20 results from an estimated 800 matches similar to: "help with rchk warnings on Rf_eval(Rf_lang2(...))"

2020 Mar 23
5
help with rchk warnings on Rf_eval(Rf_lang2(...))
Thanks, that's really useful. One more question for you, or someone else here: const ArrayXd glmLink::linkFun(const ArrayXd& mu) const { return as<ArrayXd>(::Rf_eval(::Rf_lang2(as<SEXP>(d_linkFun), as<SEXP>(Rcpp::NumericVector(mu.data(), mu.data() + mu.size())) ), d_rho); } I guess I need that to read
2020 Mar 23
0
help with rchk warnings on Rf_eval(Rf_lang2(...))
On 3/23/20 8:39 PM, Ben Bolker wrote: > Dear r-devel folks, > > [if this is more appropriate for r-pkg-devel please let me know and > I'll repost it over there ...] > > I'm writing to ask for help with some R/C++ integration idioms that are > used in a package I'm maintaining, that are unfamilar to me, and that > are now being flagged as problematic by Tomas
2020 Mar 24
2
help with rchk warnings on Rf_eval(Rf_lang2(...))
> Shield<SEXP> res(Rcpp_fast_eval(Rf_lang2(asEnvironmentSym, x), R_GlobalEnv)); The call should be protected before evaluation though. So more like: Shield<SEXP> call(Rf_lang2(asEnvironmentSym, x)); return Rcpp_fast_eval(call, R_GlobalEnv); Best, Lionel On 3/23/20, Dirk Eddelbuettel <edd at debian.org> wrote: > > > On 23 March 2020 at 17:07, Ben Bolker wrote: >
2020 Mar 24
0
help with rchk warnings on Rf_eval(Rf_lang2(...))
On 24 March 2020 at 11:39, Lionel Henry wrote: | > Shield<SEXP> res(Rcpp_fast_eval(Rf_lang2(asEnvironmentSym, x), R_GlobalEnv)); | | The call should be protected before evaluation though. So more like: | | Shield<SEXP> call(Rf_lang2(asEnvironmentSym, x)); | return Rcpp_fast_eval(call, R_GlobalEnv); Good catch. And recursive grep for Rf_lang2 in the Rcpp sources tree suggests
2019 Mar 30
3
Use of C++ in Packages
tl;dr: we need better C++ tools and documentation. We collectively know more now with the rise of tools like rchk and improved documentation such as Tomas?s post. That?s a start, but it appears that there still is a lot of knowledge that would deserve to be promoted to actual documentation of best practices. I think it is important to not equate C++ as a language, and Rcpp. Also, C++ is not
2019 Jun 18
3
Fast way to call an R function from C++?
Hi, I'm looking for a most efficient way to call an R function from C++ in a package. I know there are two functions (`R_forceAndCall` and `Rf_eval`) that can do the "call" part, but both are slow compared to calling the same function in R. I also try to use Rcpp and it is the worse one. Here is my test code: C++ code: ``` // [[Rcpp::export]] SEXP C_test1(SEXP f, SEXP x) { SEXP
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
2019 Mar 29
3
Use of C++ in Packages
I think it's also worth saying that some of these issues affect C code as well; e.g. this is not safe: FILE* f = fopen(...); Rf_eval(...); fclose(f); whereas the C++ equivalent would likely handle closing of the file in the destructor. In other words, I think many users just may not be cognizant of the fact that most R APIs can longjmp, and what that implies for cleanup of
2014 Oct 22
1
Problems to compile examples of RInside
Hello, I have some problems to migrate to R >3.0 my devel machine (R.2.15.2). So I decided to start from scratch with a brand new virtual machine. Downloaded latest network install of debian testing, not stable (jessie/sid, SMP Debian 3.16.3-2 (2014-09-20) x86_64 GNU/Linux) installed only with ssh-server and basic utilities (no X). Then I installed R by: apt-get install
2009 Sep 03
1
Running an expression 1MN times using embedded R
Hello, I'm evaluating this expression expression({ for(x in 1:5){ .Call('rh_status','x') }}) a million times from a program with R embedded in it. I have attached reproducible code that crashes with Program received signal SIGSEGV, Segmentation fault. 0x00002b499ca40a6e in R_gc_internal (size_needed=0) at memory.c:1309 1309 FORWARD_NODE(R_PPStack[i]); Current language:
2019 May 19
4
most robust way to call R API functions from a secondary thread
Hi, As the subject suggests, I am looking for the most robust way to call an (arbitrary) function from the R API from another but the main POSIX thread in a package's code. I know that, "[c]alling any of the R API from threaded code is ?for experts only? and strongly discouraged. Many functions in the R API modify internal R data structures and might corrupt these data structures if
2019 May 20
1
most robust way to call R API functions from a secondary thread
Stepan, Andreas gave a lot more thought into what you question in your reply. His question was how you can avoid what you where proposing and have proper threading under safe conditions. Having dealt with this before, I think Andreas' write up is pretty much the most complete analysis I have seen. I'd wait for Luke to chime in as the ultimate authority if he gets to it. The
2019 Apr 24
1
Use of C++ in Packages
Some of us are learning about development in R and use R in our work data analysis pipelines. What is the best way to identify packages that currently have these C++ problems? I would like to be able to help fix the bugs but more importantly not use these packages in critical work pipelines. Any C++ R package bug squashing events out there? Regards Hugh On Mon, Apr 1, 2019 at 6:23 PM Tomas
2018 Mar 29
2
Possible `substr` bug in UTF-8 Corner Case
I think there is a memory bug in `substr` that is triggered by a UTF-8 corner case: an incomplete UTF-8 byte sequence at the end of a string.? With a valgrind level 2 instrumented build of R-devel I get: > string <- "abc\xEE"??? # \xEE indicates the start of a 3 byte UTF-8 sequence > Encoding(string) <- "UTF-8" > substr(string, 1, 10) ==15375== Invalid read of
2004 Feb 17
2
interfacing C++ using .Call
Hi folks, I apologise if this is in the documentation somewhere, but I can't seem to find it. I also did a search of CRAN without any success. I'm using R-1.8.1 (pre-compiled) on Windows 2000 with Rtools and mingw 2.0.0 (which includes gcc/g++ 3.2). I'm trying to link some C++ code from another application to R using the .Call interface and am experiencing some problems. I was
2020 May 15
4
edit() doubles backslashes when keep.source=TRUE
> On Friday, May 15, 2020, 12:13:04 PM EDT, Dirk Eddelbuettel <edd at debian.org> wrote: > On 15 May 2020 at 15:41, Martin Maechler wrote: > | <whining> > | > |??? Why does nobody anymore? help R development by working with > |??? "R-devel", or at least then the alpha, beta and the "RC" > |??? (Release Candidate) versions that we release daily
2012 Apr 18
1
C - R integration: Memory Issues
Hi all, I am a PhD student and I am working on a C project that involves some statistical calculations. So, I tried to embed R into C, in order to call R functions from a C program. My program seems to get the correct results from R. However, it appears to have a lot of memory allocation issues, in contrast to the small amounts of memory that my code allocates. Some additional info
2005 Jun 27
2
R v2.1.1 for Windows and "non-reproducible" crashes
Hi, R v2.1.1 patched (2005-05-26) for Windows crashes. The sympotoms are like "memory leakage". The patched version from two days ago crashes at a different position in R CMD check compared to todays version. A "REPRODUCIBLE" EXAMPLE: Unfortunately, I cannot create a minimal code example reproducing the crash, but here is at least a simple way to reproduce it: 1. Make
2006 May 09
1
Seg fault when installing package from bad repository
> install.packages("rggobi", repos="http://ggobi.org/r/") Warning in install.packages("rggobi", repos = "http://ggobi.org/r/") : argument 'lib' is missing: using /Users/hadley/Library/R/library/ Reading symbols for shared libraries . done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at
2006 Jun 02
2
Helping out - simple bugs to help familiarize with R design, source, etc
Hi All, Well I finally have found the time to get svn working and I have successfully built my own tuned atlas (multi-threaded version) libs and have both the r-devel and r-patched trees building daily on my box. The problem is I still do not have a good idea of the layout and design of R, and typically I "learn by doing" by trying to fix a bug that hits me. Unfortunately ;-)