Re: [Rd] Typo in help(parse_Rd, package="tools")
On 26/10/2009 10:44 PM, Henrik Bengtsson wrote: Under See Also in help(parse_Rd, package="tools") it says: Rd2HTML for the converters that use the output of parseRd. Should be "parse_Rd" not "parseRd". Thanks, fixed. Duncan Murdoch sessionInfo() R version 2.10.0 Patched (2009-10-26 r50212) i386-pc-mingw32 locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.10.0 /H __ 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] Me or a bug? Package Install does not unzip (PR#14026)
Today I installed R 2.10.0 1. I try to download maptools again. 2. Downloads to a temp subdirectory somewhere. > utils:::menuInstallPkgs() trying URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.10/maptools_0.7-26.zip' Content type 'application/zip' length 1038205 bytes (1013 Kb) opened URL downloaded 1013 Kb package 'maptools' successfully unpacked and MD5 sums checked The downloaded packages are in C:\Documents and Settings\Jim Burke\Local Settings\Temp\RtmpaNjPrZ\downloaded_packages 3. Does NOT automatically invoke the zip file. Does NOT unzip. My zip program is jZip. When I click on a zip suffixed file, it brings up the jZip program. So file associations are OK. Thanks for any suggestions, Jim Burke __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R CMD check: Error in .C
Many thanks Mathieu, following your answer I did a bit more focused research and found out that because "mypackage" had a NAMESPACE, I had to create the following zzz.R file instead: .onLoad <-function (lib, pkg) { library.dynam("mypackage", pkg, lib) } I then had a look in "Writing R extensions" to see if I had just missed this precious info, but though they mention: "If the ‘src’ subdirectory of an add-on package contains source code with one of the extensions listed above or a file ‘Makevars’ but not a file Makefile, R CMD INSTALL creates a shared object (for loading into R in the .First.lib or .onLoad function of the package) using the R CMD SHLIB mechanism. If file ‘Makevars’ exists it is read first, then the system makefile and then any personal ‘Makevars’ files." To a novice like me, I really think this is not clear enough. It would be nice if "Writing R extensions" was a bit more explicit about this zzz.R solution. Le 26 octobre 2009 23:44, Mathieu Ribatet a écrit : > > Dear Etienne, > > You probably want to create a zzz.R file in the /mypkg/R/ folder which > is just > > .First.lib <- function(lib, pkg){ > library.dynam("MyPkgName", package = pkg, lib.loc = lib) > return(invisible(0)) > } > > This would ensure that your shared library will be loaded. > > Best, > Mathieu > > Le lundi 26 octobre 2009 à 03:58 +0100, Etienne Laliberté a écrit : > > Function/file names are hypothetical. Say I have written myfunction.R, > > which calls myfunction.c via .C("myfunction", ...). > > > > I've compiled successfully myfunction.c via R CMD SHLIB myfunction.c > > in the terminal. Then, in the R console: > > > > dyn.load("myfunction.so") > > source("myfunction.R") > > test <- myfunction() # works fine > > > > So everything is in order, myfunction works perfectly. > > > > Now I want to include myfunction() into a package called mypackage. > > Here's what I did: > > > > 1) I've added PACKAGE = "mypackage" in the .C() line in myfunction.R. > > 2) I put myfunction.R into the R folder of mypackage > > 3) I put myfunction.c into the src folder of mypackage > > 4) I created myfunction.Rd into the man folder > > > > I then build the package via R CMD build mypackage. All good. However, > > when I run R CMD check mypackage, I get the following error (note that > > I translated from french, might be a bit different in english): > > > > Error in .C("myfunction", ...): C symbol name "myfunction" cannot be > > found in the DLL for package "mypackage" > > > > I would appreciate some help here. Please do not refer my to "Writing > > R extensions" - if the answer's in there, I don't understand it. > > > > Many thanks. > > > > -- > > Etienne Laliberté > > > > Rural Ecology Research Group > > School of Forestry > > University of Canterbury > > Private Bag 4800 > > Christchurch 8140, New Zealand > > Phone: +64 3 366 7001 ext. 8365 > > Fax: +64 3 364 2124 > > www.elaliberte.info > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > -- > Institute of Mathematics > Ecole Polytechnique Fédérale de Lausanne > STAT-IMA-FSB-EPFL, Station 8 > CH-1015 Lausanne Switzerland > http://stat.epfl.ch/ > Tel: + 41 (0)21 693 7907 > -- Etienne Laliberté Rural Ecology Research Group School of Forestry University of Canterbury Private Bag 4800 Christchurch 8140, New Zealand Phone: +64 3 366 7001 ext. 8365 Fax: +64 3 364 2124 www.elaliberte.info __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R CMD check: Error in .C
[ Note that this discussion really belongs to r-help, not r-devel, but a nyway. > On Tue, 27 Oct 2009 09:02:12 +1300, > Etienne Laliberté (EL) wrote: > Many thanks Mathieu, following your answer I did a bit more focused > research and found out that because "mypackage" had a NAMESPACE, I had > to create the following zzz.R file instead: > .onLoad <-function (lib, pkg) { > library.dynam("mypackage", pkg, lib) > } If you have a namespace you only need a useDynLib(mypackage) in the NAMESPACE file, everything else is done automatically for you (no need for the above zzz.R). Best, Fritz -- --- Prof. Dr. Friedrich Leisch Institut für Statistik Tel: (+49 89) 2180 3165 Ludwig-Maximilians-Universität Fax: (+49 89) 2180 5308 Ludwigstraße 33 D-80539 München http://www.statistik.lmu.de/~leisch --- Journal Computational Statistics --- http://www.springer.com/180 Münchner R Kurse --- http://www.statistik.lmu.de/R __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Me or a bug? Package Install does not unzip (PR#14026)
On 27/10/2009 3:10 AM, j.bu...@earthlink.net wrote: Today I installed R 2.10.0 1. I try to download maptools again. 2. Downloads to a temp subdirectory somewhere. > utils:::menuInstallPkgs() trying URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.10/maptools_0.7-26.zip' Content type 'application/zip' length 1038205 bytes (1013 Kb) opened URL downloaded 1013 Kb package 'maptools' successfully unpacked and MD5 sums checked The downloaded packages are in C:\Documents and Settings\Jim Burke\Local Settings\Temp\RtmpaNjPrZ\downloaded_packages 3. Does NOT automatically invoke the zip file. Does NOT unzip. This doesn't look like a bug, it looks as though things are fine (it says "successfully unpacked"). What is not working? Duncan Murdoch My zip program is jZip. When I click on a zip suffixed file, it brings up the jZip program. So file associations are OK. Thanks for any suggestions, Jim Burke __ 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] R on maemo
Has anyone tried to compile R on the Nokia maemo platform? I've been thinking about buying the n900 phone when it comes out, but I guess the main selling point would be a possibility to run R on it. I've read some rumors that it is based on debian, and that it can run X11 apps. In theory, you wouldn't even need to write any GUI. You should be able to run R in command line mode, with plots appearing as X11 windows. http://cool900.blogspot.com/2009/10/comparing-freedom-on-maemo-and-android.html juha __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] recover and "called from" information
Hello, When using recover, the called from information is always "eval(expr, envir, enclos)", which is not particularly useful. > f <- function( ){ g <- function(){ stop( "ouch") }; g() } > options( error = recover ) > f() Error in g() : ouch Enter a frame number, or 0 to exit 1: f() 2: g() Selection: 1 Called from: eval(expr, envir, enclos) I'm using the following heuristic to guess if this was called from recover and grab the actual call, and was wondering if something similar could/should be integrated into R: getcall <- function(){ calls <- sys.calls() calls <- calls[ -length(calls) ] funs <- sapply( calls, function(x) as.character(x)[1L] ) frames <- sys.frames() frames <- frames[ -length(frames) ] nc <- length(calls) if( nc >= 3L && identical( tail(funs, 2L ), rep("eval", 2L) ) && identical( paste( as.character( calls[[ nc - 1L ]] ), collapse = "--" ), "eval--quote(browser())--sys.frame(which)" ) ) { w <- get( "which", sys.frame(nc- 2L ), inherits = FALSE ) if( typeof( w ) == "integer" && length(w) == 1L ){ return( calls[[w]] ) } } calls[[nc]] } I'd be happy to work on an internal version instead of this one in R. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/BcPw : celebrating R commit #5 |- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc `- http://tr.im/yw8E : New R package : sos __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R on maemo
On Oct 27, 2009, at 12:13 , Juha Vierinen wrote: Has anyone tried to compile R on the Nokia maemo platform? I've been thinking about buying the n900 phone when it comes out, but I guess the main selling point would be a possibility to run R on it. I've read some rumors that it is based on debian, and that it can run X11 apps. In theory, you wouldn't even need to write any GUI. You should be able to run R in command line mode, with plots appearing as X11 windows. I didn't actually do it but given that the hardware is almost identical to the iPhone I'd say the chances are pretty good that it should work (simply cross-compile using ARM target bi-arch R for host and target as discussed for iPhone and Android). As you pointed out the UI situation is even easier although the devil may be in the details. Still, I don't think R is a useful application on a mobile device -- IMHO the future is in a thin mobile client accessing the cloud (which runs R among other things) since there is no point in trying to use the low-power CPUs for computing. Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] odd evaluation within correlation argument of glmmPQL
Ben Bolker wrote: > > > [snip] > > It appears that glmmPQL looks in the global workspace, not > within the data frame specified by the "data" argument, for > the variables specified in the "form" argument of spatial > correlation structures provided to the "correlation" argument. > > [snip example and patches] > > Replying to my own e-mail to bump this (it's been a week). The basic issue is that glmmPQL throws out data that are not involved in the fixed or random model terms, or in the offset term. It doesn't save variables that are only found in the correlation formula argument. It's hard to imagine how this behavior is anything other than a bug ... and the patch fixes it in a straightforward way. cheers Ben Bolker -- View this message in context: http://www.nabble.com/odd-evaluation-within-correlation-argument-of-glmmPQL-tp25986187p26083255.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] inaccurate integer conversion in coercion
Hi, > as.integer(100) # 10 billions [1] NA Warning message: NAs introduced by coercion > as.integer(-100) # minus 10 billions [1] NA Warning message: NAs introduced by coercion > as.integer("100") # 10 billions as a string [1] 2147483647 Warning message: inaccurate integer conversion in coercion > as.integer("-100") # minus 10 billions as a string [1] NA Warning message: inaccurate integer conversion in coercion Why is the "10 billions as a string" case treated differently? (coerced to INT_MAX-1) And for the "minus 10 billions as a string" case, is the warning message really appropriate? Why isn't it just the usual "NAs introduced by coercion"? Thanks, H. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel