Re: [Rd] Installation problem from R 2.8.x
True, /tmp is noexec and this is generally a good practice for system security. Okay, I'll define TMPDIR=$HOME/tmp for the R package admin on our systems. I think it'd be good if R developers could consider to add something like: If $TMPDIR is not executable, then EITHER "error message" OR "mkdir $HOME/tmp; chmod u+x $HOME/tmp; TMPDIR=$HOME/tmp; export TMPDIR" in src/library/tools/R/install.R or wherever you seem to fit. Regards, Zong-Pei On Wed, 30 Sep 2009, William Dunlap wrote: Date: Wed, 30 Sep 2009 10:30:32 -0700 From: William Dunlap To: Uwe Ligges , zong-pei@imm.ox.ac.uk Cc: r-devel@r-project.org Subject: RE: [Rd] Installation problem from R 2.8.x In September 2009 Matias Silva reported a execution permission problem during a package installation (look in the r-devel archives for ' [Rd] Installing rJava RJDBC bad interpreter: Permission denied'). It was due to the fstab file marking /tmp as noexec, hence nothing in /tmp was executable, regardless of its file mode. Since the package was copied to /tmp before compilation he ran into the problem. I think he worked around it by setting TMPDIR=/var/tmp, where /var/tmp did not have this restriction, before doing the install. His error message was different but you might be having a similar problem. Bill Dunlap TIBCO Software Inc - Spotfire Division wdunlap tibco.com > -Original Message- > From: r-devel-boun...@r-project.org > [mailto:r-devel-boun...@r-project.org] On Behalf Of Uwe Ligges > Sent: Wednesday, September 30, 2009 9:49 AM > To: zong-pei@imm.ox.ac.uk > Cc: r-devel@r-project.org > Subject: Re: [Rd] Installation problem from R 2.8.x > > What you call a bug in R has never been reported since R-2.8.0 was > recent. Hence I guess it is a permission issue on your system. > Or do you think nobody else tried to install a package during > the last > 12 months? > > Uwe Ligges > > > zong-pei@imm.ox.ac.uk wrote: > > Dear Developers, > > > > Since 2.8, R installation has got a bug in it such > > that if a package has a "configure" file then it > > cannot be installed without modification. > > > > For example: > > > > * Installing *source* package 'foreign' ... > > ERROR: 'configure' exists but is not executable -- > > see the 'R Installation and Adminstration Manual' > > * Removing '/usr/local/source_code/Linux/R/R-2.9.2/library/foreign' > > make[2]: *** [foreign.ts] Error 1 > > > > In fact, 'configure' is executable!!! So I have to manually > > run 'configure', remove 'configure', and then repackage > > foreign_0.8-37.tar.gz so it can be installed. > > > > This bug makes it very time consuming to add any package > > which has a 'configure' in it. And the bug seems to be > > in src/library/tools/R/install.R > > > > Regards, > > > > Dr Zong-Pei Han > > UNIX Systems Administrator > > Computational Biology Research Group > > University of Oxford > > http://www.cbrg.ox.ac.uk/ > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Dependency 'sma' is not available
So packages like beadarray and arrayQualityMetrics cannot be installed. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Dependency 'sma' is not available
zong-pei@imm.ox.ac.uk wrote: > So packages like beadarray and arrayQualityMetrics > cannot be installed. The sma author no longer wishes to maintain this package. The packges beadarray and arrayQualityMetrics are Bioconductor packages that depend on sma indirectly through other packages. The other packages are being revised to no longer depend on sma, but this has not yet been completed. The workaround is to manually install sma from its archive: download http://cran.fhcrc.org/src/contrib/Archive/sma/sma_0.5.15.tar.gz and install.packages("sma_0.5.15.tar.gz", repos=NULL). beadarray and arrayQualityMetrics are Bioconductor packages, so please follow up on the Bioconductor mailing list http://bioconductor.org/docs/mailList.html Martin > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] creating environments in package's C code
Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient. Best wishes, Martin -- Dr. Martin Becker Statistics and Econometrics Saarland University Campus C3 1, Room 206 66123 Saarbruecken Germany __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] creating environments in package's C code
Martin Becker wrote: Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient. Best wishes, Here's a function I use in rapache to create one: static SEXP NewEnv(SEXP enclos){ SEXP env; PROTECT(env = allocSExp(ENVSXP)); SET_FRAME(env, R_NilValue); SET_ENCLOS(env, (enclos)? enclos: R_GlobalEnv); SET_HASHTAB(env, R_NilValue); SET_ATTRIB(env, R_NilValue); UNPROTECT(1); return env; } and an example that creates a new environment and then assigns a variable named OK an integer vector length 1 with value 0: SEXP env = NewEnv(R_GlobalEnv); defineVar(install("OK"),NewInteger(0),env); Best Jeff __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] creating environments in package's C code
On Oct 1, 2009, at 11:33 , Martin Becker wrote: Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient. Rf_NewEnvironment is the function that does it, e.g., Rf_NewEnvironment(R_NilValue, R_NilValue, parent) it's not part of the official API (headers) but it is visible. For hashed environments it's R_NewHashedEnv(). Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] creating environments in package's C code
Jeff Horner wrote: Martin Becker wrote: Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient. Best wishes, Here's a function I use in rapache to create one: static SEXP NewEnv(SEXP enclos){ SEXP env; PROTECT(env = allocSExp(ENVSXP)); SET_FRAME(env, R_NilValue); SET_ENCLOS(env, (enclos)? enclos: R_GlobalEnv); SET_HASHTAB(env, R_NilValue); SET_ATTRIB(env, R_NilValue); UNPROTECT(1); return env; } Oops! I forgot the definition of my simple function NewInteger: static SEXP NewInteger(int i){ SEXP val; PROTECT(val = NEW_INTEGER(1)); INTEGER_DATA(val)[0] = i; UNPROTECT(1); return val; } and an example that creates a new environment and then assigns a variable named OK an integer vector length 1 with value 0: SEXP env = NewEnv(R_GlobalEnv); defineVar(install("OK"),NewInteger(0),env); Best Jeff __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Rd.sty question: LaTeX expert needed
The Rd.sty LaTeX package is used when building the R manuals, and by the LaTeX pages produced from the man pages. I have tracked down some problems Gábor Csárdi was having recently (see "Re: [R] preformatted and '#' in manual pages" in R-help) to a LaTeX problem, and am trying to work out how to fix it. Specifically, the .Rd file he was using had a structure like \dQuote{ ... \preformatted{ line 1 line 2 } } which tools::Rd2latex in R translates to the similar LaTeX code \dQuote{ ... \begin{alltt} line 1 line 2 \end{alltt} } The problem is that the alltt environment (which is a sort of verbatim environment, except macros are allowed) doesn't work when embedded like this in the \dQuote{} macro. Gábor was getting errors when his line 1 contained a # symbol, and when I dealt with that, I found the formatting was getting messed up, and the section ended up being rendered as line 1 line 2 The \dQuote macro has a simple definition in Rd.sty as \newcommand{\dQuote}[1]{``#1''} so I expect the same error will happen with many other macros in Rd.sty. So, my questions: Is there a known workaround for this in alltt? If not, I could skip the macro expansion of \dQuote by generating the quotes directly in Rd2latex, and most other macros could be handled similarly. However, then nobody who uses Rd.sty would be able to redefine the look of those macros and have things display properly. A third possibility is that we could make it illegal to nest \preformatted within other macros, but that seems to be an unfortunate limitation. Any help would be appreciated. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] creating environments in package's C code
Jeff, On Oct 1, 2009, at 12:37 , Jeff Horner wrote: Jeff Horner wrote: Martin Becker wrote: Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient. Best wishes, Here's a function I use in rapache to create one: static SEXP NewEnv(SEXP enclos){ SEXP env; PROTECT(env = allocSExp(ENVSXP)); SET_FRAME(env, R_NilValue); SET_ENCLOS(env, (enclos)? enclos: R_GlobalEnv); SET_HASHTAB(env, R_NilValue); SET_ATTRIB(env, R_NilValue); UNPROTECT(1); return env; } eek ... that some dangerous bit of code ;). I think Rf_NewEnviroment is safer even if it's not the headers :P. Oops! I forgot the definition of my simple function NewInteger: static SEXP NewInteger(int i){ SEXP val; PROTECT(val = NEW_INTEGER(1)); INTEGER_DATA(val)[0] = i; UNPROTECT(1); return val; } I suspect you like reinventing the wheel ;). Your NewInteger is part of the R API and is called ScalarInteger(). When you need something, chances are that R has it already, so it's worth greping through the headers (and sometimes even through the main sources). Cheers, Simon and an example that creates a new environment and then assigns a variable named OK an integer vector length 1 with value 0: SEXP env = NewEnv(R_GlobalEnv); defineVar(install("OK"),NewInteger(0),env); Best Jeff __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] creating environments in package's C code
On 10/1/2009 12:37 PM, Jeff Horner wrote: Jeff Horner wrote: Martin Becker wrote: Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient. Best wishes, Here's a function I use in rapache to create one: static SEXP NewEnv(SEXP enclos){ SEXP env; PROTECT(env = allocSExp(ENVSXP)); SET_FRAME(env, R_NilValue); SET_ENCLOS(env, (enclos)? enclos: R_GlobalEnv); SET_HASHTAB(env, R_NilValue); SET_ATTRIB(env, R_NilValue); UNPROTECT(1); return env; } Oops! I forgot the definition of my simple function NewInteger: static SEXP NewInteger(int i){ SEXP val; PROTECT(val = NEW_INTEGER(1)); INTEGER_DATA(val)[0] = i; UNPROTECT(1); return val; } and an example that creates a new environment and then assigns a variable named OK an integer vector length 1 with value 0: SEXP env = NewEnv(R_GlobalEnv); defineVar(install("OK"),NewInteger(0),env); One comment: I would protect the env, because install() and NewInteger() could each trigger a garbage collection. That is, use SEXP env; PROTECT(env = NewEnv(R_GlobalEnv)); defineVar(install("OK"),NewInteger(0),env); UNPROTECT(1); Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character' & 'getEncChar' must be called on a CHARSXP
Hello, I have list of 600K lists, each sublist a list of two elements, the first a character, the second a list of six named elements, some characters some numrics. LISTA (600K) (:= h) |__ List of two elements |__ Character |__ Named List of 6 elements (characters and numerics) This works, sip <- lapply(h,function(r) r[[2]][['sip']]) but I wish to unlist this sip <- unlist(lapply(h,function(r) r[[2]][['sip']])) and get the following error: Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'list' Debugging to find which: i<-1 sip <- unlist(lapply(h,function(r) { i<<-i+1 #debug messages cat(i,"-->","\n"); print( r[[2]] ) #debug message r[[2]][['sip']] })) [1]Error in print.default(r[[2]]) : 'getEncChar' must be called on a CHARSXP Which occurs on the 122,204'th item. All entries r[[2]] are similar so I don't know why this happening? The strangest thing is that this error never happened a few days ago and the same code causes this to occur today. Any ideas would be helpful. Regards Saptarshi __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Rd.sty question: LaTeX expert needed
Hi, I would not claim I'm a latex expert ... In the highlight package, I also use alltt environments the latex renderer of syntax highlighted code, and I ended up masquarading a set of character (#, \, ...) into latex boxes and then use \usebox for these characters. In this file : http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/pkg/highlight/R/renderer.R?rev=168&root=highlight&view=markup The functions boxes_latex and translator_latex might interest you. The list of boxed characters might not be complete. Hope this helps, Romain On 10/01/2009 06:50 PM, Duncan Murdoch wrote: The Rd.sty LaTeX package is used when building the R manuals, and by the LaTeX pages produced from the man pages. I have tracked down some problems Gábor Csárdi was having recently (see "Re: [R] preformatted and '#' in manual pages" in R-help) to a LaTeX problem, and am trying to work out how to fix it. Specifically, the .Rd file he was using had a structure like \dQuote{ ... \preformatted{ line 1 line 2 } } which tools::Rd2latex in R translates to the similar LaTeX code \dQuote{ ... \begin{alltt} line 1 line 2 \end{alltt} } The problem is that the alltt environment (which is a sort of verbatim environment, except macros are allowed) doesn't work when embedded like this in the \dQuote{} macro. Gábor was getting errors when his line 1 contained a # symbol, and when I dealt with that, I found the formatting was getting messed up, and the section ended up being rendered as line 1 line 2 The \dQuote macro has a simple definition in Rd.sty as \newcommand{\dQuote}[1]{``#1''} so I expect the same error will happen with many other macros in Rd.sty. So, my questions: Is there a known workaround for this in alltt? If not, I could skip the macro expansion of \dQuote by generating the quotes directly in Rd2latex, and most other macros could be handled similarly. However, then nobody who uses Rd.sty would be able to redefine the look of those macros and have things display properly. A third possibility is that we could make it illegal to nest \preformatted within other macros, but that seems to be an unfortunate limitation. Any help would be appreciated. Duncan Murdoch -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc |- http://tr.im/yw8E : New R package : sos `- http://tr.im/y8y0 : search the graph gallery from R __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Rd.sty question: LaTeX expert needed
On Thu, Oct 1, 2009 at 6:50 PM, Duncan Murdoch wrote: [...] > \dQuote{ > ... > \preformatted{ > line 1 > line 2 > } > } > [...] Oh, there was a dQuote as well, I must be an idiot for not noticing it. :( Anyway, for me, I will just remove the dQuote and everything will be fine. Sorry, this is not a solution for the more general problem Thanks for your help, Gabor -- Gabor Csardi UNIL DGM __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] creating environments in package's C code
Simon Urbanek wrote: Jeff, On Oct 1, 2009, at 12:37 , Jeff Horner wrote: Jeff Horner wrote: Martin Becker wrote: Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient. Best wishes, Here's a function I use in rapache to create one: static SEXP NewEnv(SEXP enclos){ SEXP env; PROTECT(env = allocSExp(ENVSXP)); SET_FRAME(env, R_NilValue); SET_ENCLOS(env, (enclos)? enclos: R_GlobalEnv); SET_HASHTAB(env, R_NilValue); SET_ATTRIB(env, R_NilValue); UNPROTECT(1); return env; } eek ... that some dangerous bit of code ;). I think Rf_NewEnviroment is safer even if it's not the headers :P. Interesting. I know that I patterned that function after some grepping for ENVSXP, probably src/main/serialize.c's ReadItem() as it's similar. Plus I only used what was available from the public headers. So, if Rf_NewEnviroment is the right way to do it then make it public ;P. Oops! I forgot the definition of my simple function NewInteger: static SEXP NewInteger(int i){ SEXP val; PROTECT(val = NEW_INTEGER(1)); INTEGER_DATA(val)[0] = i; UNPROTECT(1); return val; } I suspect you like reinventing the wheel ;). Your NewInteger is part of the R API and is called ScalarInteger(). When you need something, chances are that R has it already, so it's worth greping through the headers (and sometimes even through the main sources). Yes, that I created NewInteger is a grave oversight on my part. It's been around since R's first release (if my svn log research was correct). Thanks. I'm putting it on rapache's TODO list to take it out. Jeff Cheers, Simon and an example that creates a new environment and then assigns a variable named OK an integer vector length 1 with value 0: SEXP env = NewEnv(R_GlobalEnv); defineVar(install("OK"),NewInteger(0),env); Best Jeff __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] X11 Problems
Hi all, I'm having trouble getting x11 to work with R. (This is on Debian testing.) I installed r-base and r-base-dev, and then r-cran-cairodevice. I also tried installing the Cairo package within R, which appears to work fine. This what I'm seeing: > capabilities() jpeg png tifftcltk X11 aqua http/ftp sockets TRUE TRUE TRUE TRUEFALSEFALSE TRUE TRUE libxml fifo clediticonv NLS profmemcairo TRUE TRUE TRUE TRUE TRUE TRUE TRUE > x11() Error in X11(d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype, : unable to start device X11cairo In addition: Warning message: In x11() : unable to open connection to X11 display '' Any help would be appreciated! Thanks, Kay __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character' & 'getEncChar' must be called on a CHARSXP
Saptarshi, how did you create those lists? Can you send us the code? If not, can you put up the .RData file? Without a reproducible example this is hard to debug ... Thanks, Simon On Oct 1, 2009, at 14:26 , Saptarshi Guha wrote: Hello, I have list of 600K lists, each sublist a list of two elements, the first a character, the second a list of six named elements, some characters some numrics. LISTA (600K) (:= h) |__ List of two elements |__ Character |__ Named List of 6 elements (characters and numerics) This works, sip <- lapply(h,function(r) r[[2]][['sip']]) but I wish to unlist this sip <- unlist(lapply(h,function(r) r[[2]][['sip']])) and get the following error: Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'list' Debugging to find which: i<-1 sip <- unlist(lapply(h,function(r) { i<<-i+1 #debug messages cat(i,"-->","\n"); print( r[[2]] ) #debug message r[[2]][['sip']] })) [1]Error in print.default(r[[2]]) : 'getEncChar' must be called on a CHARSXP Which occurs on the 122,204'th item. All entries r[[2]] are similar so I don't know why this happening? The strangest thing is that this error never happened a few days ago and the same code causes this to occur today. Any ideas would be helpful. Regards Saptarshi __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character' & 'getEncChar' must be called on a CHARSXP
Hello I could send a .Rdata file but it doesn't load throwing a similar error. I can go through the code (below) Now if instead of A0-A3 and B0-B3, i simply create a RAWSEXP and copy the the raw bytes (in kvhold) return this list of two-element lists containing raw bytes and then call lapply(h, function(r) list(rhuz(r[[1]],r[[2]]))) #where h is what is returned from the code below where rhuz is a wrapper around the functions called in A0-A3, it works So i'm quite confused here. Thank you for your time (R-2.9.1) Regards Saptarshi //using NewList and GrowList from R sources SEXP rv; PROTECT( rv = NewList()); while(true){ // read an integer kvlength // then read kvlength bytes into kvhold // (from a file) // The KEY PROTECT(l = Rf_allocVector(VECSXP,2)); REXP *rexp1 = new REXP(); //A0 rexp1->ParseFromArray( kvhold, kvlength ); //A1 PROTECT(k = message2rexp(*rexp1)); //A2 delete(rexp1); //A3 SET_VECTOR_ELT( l, 0, k); // read an integer kvlength // then read kvlength bytes into kvhold // (from a file) // The VALUE REXP *rexp2 = new REXP(); //B0 rexp2->ParseFromArray( kvhold, kvlength );//B1 PROTECT(k = message2rexp(*rexp2));//B2 delete(rexp2); //B3 SET_VECTOR_ELT( l, 1, k); //Rf_PrintValue successfully prints both k for all k UNPROTECT(3); // the two k's and l rv = GrowList(rv, l); //We break when kvlength==-1 } //now return a list containing the objects //similar to code in R src/main rv = CDR(rv); SEXP rval; PROTECT(rval = Rf_allocVector(VECSXP, Rf_length(rv))); for (int n = 0 ; n < LENGTH(rval) ; n++, rv = CDR(rv)){ SET_VECTOR_ELT(rval, n, CAR(rv)); } UNPROTECT(2); //rval and rv return(rval) On Thu, Oct 1, 2009 at 5:36 PM, Simon Urbanek wrote: > Saptarshi, > > how did you create those lists? Can you send us the code? If not, can you > put up the .RData file? Without a reproducible example this is hard to debug > ... > > Thanks, > Simon > > > On Oct 1, 2009, at 14:26 , Saptarshi Guha wrote: > >> Hello, >> I have list of 600K lists, each sublist a list of two elements, the first >> a character, the second a list of six named elements, some characters some >> numrics. >> LISTA (600K) (:= h) >> |__ List of two elements >> |__ Character >> |__ Named List of 6 elements (characters and numerics) >> >> This works, >> sip <- lapply(h,function(r) r[[2]][['sip']]) >> >> but I wish to unlist this >> >> sip <- unlist(lapply(h,function(r) r[[2]][['sip']])) >> >> and get the following error: >> Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'list' >> Debugging to find which: >> >> i<-1 >> sip <- unlist(lapply(h,function(r) { >> i<<-i+1 #debug messages >> cat(i,"-->","\n"); print( r[[2]] ) #debug message >> r[[2]][['sip']] >> })) >> >> [1]Error in print.default(r[[2]]) : 'getEncChar' must be called on a >> CHARSXP >> >> >> Which occurs on the 122,204'th item. All entries r[[2]] are similar so I >> don't know why this happening? >> The strangest thing is that this error never happened a few days ago and >> the same code causes this to occur today. >> >> >> Any ideas would be helpful. >> Regards >> Saptarshi >> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> >> > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character' & 'getEncChar' must be called on a CHARSXP
On Oct 1, 2009, at 6:26 PM, Saptarshi Guha wrote: Hello I could send a .Rdata file but it doesn't load throwing a similar error. That is a strong indicator that you're creating some invalid R objects in your C code, so the problem is likely there, not in R ... The code below is way incomplete, you can have the bug pretty much anywhere out of sight so there is not much we can help you with... Cheers, Simon I can go through the code (below) Now if instead of A0-A3 and B0-B3, i simply create a RAWSEXP and copy the the raw bytes (in kvhold) return this list of two-element lists containing raw bytes and then call lapply(h, function(r) list(rhuz(r[[1]],r[[2]]))) #where h is what is returned from the code below where rhuz is a wrapper around the functions called in A0-A3, it works So i'm quite confused here. Thank you for your time (R-2.9.1) Regards Saptarshi //using NewList and GrowList from R sources SEXP rv; PROTECT( rv = NewList()); while(true){ // read an integer kvlength // then read kvlength bytes into kvhold // (from a file) // The KEY PROTECT(l = Rf_allocVector(VECSXP,2)); REXP *rexp1 = new REXP(); //A0 rexp1->ParseFromArray( kvhold, kvlength ); //A1 PROTECT(k = message2rexp(*rexp1)); //A2 delete(rexp1); //A3 SET_VECTOR_ELT( l, 0, k); // read an integer kvlength // then read kvlength bytes into kvhold // (from a file) // The VALUE REXP *rexp2 = new REXP(); //B0 rexp2->ParseFromArray( kvhold, kvlength );//B1 PROTECT(k = message2rexp(*rexp2));//B2 delete(rexp2); //B3 SET_VECTOR_ELT( l, 1, k); //Rf_PrintValue successfully prints both k for all k UNPROTECT(3); // the two k's and l rv = GrowList(rv, l); //We break when kvlength==-1 } //now return a list containing the objects //similar to code in R src/main rv = CDR(rv); SEXP rval; PROTECT(rval = Rf_allocVector(VECSXP, Rf_length(rv))); for (int n = 0 ; n < LENGTH(rval) ; n++, rv = CDR(rv)){ SET_VECTOR_ELT(rval, n, CAR(rv)); } UNPROTECT(2); //rval and rv return(rval) On Thu, Oct 1, 2009 at 5:36 PM, Simon Urbanek wrote: Saptarshi, how did you create those lists? Can you send us the code? If not, can you put up the .RData file? Without a reproducible example this is hard to debug ... Thanks, Simon On Oct 1, 2009, at 14:26 , Saptarshi Guha wrote: Hello, I have list of 600K lists, each sublist a list of two elements, the first a character, the second a list of six named elements, some characters some numrics. LISTA (600K) (:= h) |__ List of two elements |__ Character |__ Named List of 6 elements (characters and numerics) This works, sip <- lapply(h,function(r) r[[2]][['sip']]) but I wish to unlist this sip <- unlist(lapply(h,function(r) r[[2]][['sip']])) and get the following error: Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'list' Debugging to find which: i<-1 sip <- unlist(lapply(h,function(r) { i<<-i+1 #debug messages cat(i,"-->","\n"); print( r[[2]] ) #debug message r[[2]][['sip']] })) [1]Error in print.default(r[[2]]) : 'getEncChar' must be called on a CHARSXP Which occurs on the 122,204'th item. All entries r[[2]] are similar so I don't know why this happening? The strangest thing is that this error never happened a few days ago and the same code causes this to occur today. Any ideas would be helpful. Regards Saptarshi __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Windows Laptop specification query
Thanks everyone for advice on this matter. I've been asked to report our conclusion. We have decide to order a duo processor(3.06GHz) Dell Precision 4400 laptop with 8GB memory and 500GB disk. It will be running Vista 64 bit to begin with, moving over to Windows 7 once a little experience is gained with it elsewhere. We will leave the multi CPU use of R to our larger unix servers. cheers, Keith Prof Brian Ripley wrote: The answer to (1) is in the rw-FAQ, so see library(fortunes) fortune('WTFM') On Mon, 28 Sep 2009, Corrado wrote: 1) Would a package compiled for Windows 32bit run on Windows 64 bit and use the extended memory or not? 2) As for buying a performant laptop for R, I bought a Dell M6300 mobile workstation which is actually portable, and installed Kubuntu 904 64 bit alongside the standard windows installation. When I run R I only use it in Linux and access the data in Windows through the file system. If I need to run Office because some one else is sending me document to correct, I have installed Windows XP Pro SP3 in a virtual machine using Virtual Box, which runs very fairly on the M6300, and can switch it on and off whenever I need (booting on the virtual machine is matter of few seconds). This setup allows for running 64 bit R on Linux (eventually compiled with -O3 -march=native by the way, if you feel like experimenting) which is more performant and used the memory more efficiently, without loosing the interacting with your windows based colleagues. The virtual machine can go full screen at the click of a mouse :D and it looks as if you were using a native Windows machine. You can install all software and network clients on the virtual machine. I have not booted Windows for ages I have been using this machine fort he last 18 months. The dual core works great (I chose the top processor to run simulations when I am not in the office), and in Linux you can control the CPU frequency. The new one which substitutes the M6300 is the M6400 and I would go for that possibly (Linux supported): http://www1.euro.dell.com/uk/en/business/Laptops/workstation-precision-m6400- cov/pd.aspx?refid=workstation-precision-m6400-cov&s=bsd&cs=ukbsdt1 PS: I apologise for the question on memory management but I have never used R on Windows but some free spirit decided to release a package only for Windows and only pre compiled (no sources) and I need to use it to compare (Sorry for the harsh comment and the rant , but I am not sure it is really fair to use an open source packages and programming languages for you daily work and make money out of it, and the first time you release something you release it crappy and closed source even if it is legal and allowed of course : ( ) On Monday 28 September 2009 09:16:23 Prof Brian Ripley wrote: On Mon, 28 Sep 2009, Sean O'Riordain wrote: Good morning Keith, Have a look at http://cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be- a-limit-on-the-memory-it-uses_0021 The short answer is that "it depends"... a) memory is limited under windows Yes, but 64-bit builds can be used on Windows -- that needs commercial compilers and there are commercial vendors of such builds. Even with the CRAN binary, a 64-bit version of Windows offers double the memory over a (vanilla) 32-bit version. b) R is essentially a serial program - HOWEVER it depends what you're actually doing - if you're working with large matrices then there are parallel versions of BLAS that can be used... On a multi-core windows machine with lots of memory you can of course run up multiple copies of R and run each independently There are several packages that parallelize their computations with MPI etc, and others that help with parallelization (papply, foreach, gputools, ). And apart from Rmpi/rpvm/snow there is also 'multicore', but not on Windows. See the R-sig-hpc list for follow up on such issues. As for Vista vs Windows 7, this is not the right list but Windows 7 behaves just like a version of Vista as far as we have explored it (and the current rw-FAQ includes it and Server 2008 in the Vista section). Many of us have bought dual quad-core servers in the last year or so: that includes Uwe Ligges' winbuilder machine. I suspect most of the usage is separate R jobs running simultaneously: certainly that is the case in my dept (where there are at least 6 8-core servers running R jobs). Kind regards, Sean On Mon, Sep 28, 2009 at 4:40 AM, Keith Satterley wrote: I've read some postings back in 2002/2006 about running R on multiple core CPUs. The answer was basically separate processes work fine, but parallelization needs to be implemented using snow/rmpi. Are the answers still the same? I ask because we are about to order a laptop running Windows for a new staff member. Some advice on the following would be helpful. It will be ordered with Vista, with a free upgrade to Windows 7. It will have 8GB of m