[Rd] package.skeleton() in R-2.4.1
Hi R version 2.4.0 alpha (2006-09-06 r39158) MacOSX 10.4.7 There was a thread some time ago as to whether the structure created by package.skeleton() would pass R CMD check. I have an example where package.skeleton() gives an R file that gives an error when sourced. If I type setClass("brob", representation = representation (x="numeric",positive="logical"), prototype = list(x=numeric(),positive=logical()) ) setGeneric("getX",function(x){standardGeneric("getX")}) setMethod("getX","brob",function(x)[EMAIL PROTECTED]) (which is legal, AFAICS), then package.skeleton(path="~") I get a file ~/anRpackage/R/getX.R containing: "getX" <- structure(function(x){standardGeneric("getX")} , generic = structure("getX", package = ".GlobalEnv"), package = ".GlobalEnv", group = list(), valueClass = character(0), signature = "x", default = , skeleton = quote(function (x) stop("invalid call in method dispatch to 'getX' (no default method)", domain = NA)(x)), class = structure ("nonstandardGenericFunction", package = "methods")) [subject to line breaking] but this file gives an error when sourced (below). I didn't get this problem with R-2.3.1. > > source("/Users/rksh/anRpackage/R/getX.R") Error in parse(file, n = -1, NULL, "?") : syntax error at 2: structure(function(x){standardGeneric("getX")} 3: , generic = structure("getX", package = ".GlobalEnv"), package = ".GlobalEnv", group = list(), valueClass = character(0), signature = "x", default = < > Am I doing something wrong? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] problems in installing packages with R version 2.4.0 alpha (2006-09-05 r39134)
> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> > on Mon, 11 Sep 2006 22:25:58 +0100 (BST) writes: BDR> At least some of this will go away if you use a current BDR> version of 2.4.0 alpha rather than one that is a week BDR> old (as the posting guide does ask). We are now at BDR> r39258, and some of those binary packages were built BDR> against a substantially later version of 2.4.0 alpha. [] Still "Thank you, Rich!" for running R-alpha and your report. We are grateful for everyone who does use R-alpha and reports "unusual" findings, even if some of them are already known to the R developers. Martin __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] problems in installing packages with R version 2.4.0 alpha (2006-09-05 r39134)
Prof Brian Ripley wrote: > At least some of this will go away if you use a current version of 2.4.0 > alpha rather than one that is a week old (as the posting guide does ask). > We are now at r39258, and some of those binary packages were built against > a substantially later version of 2.4.0 alpha. > > If you look at the list of available packages at > > http://cran.r-project.org/bin/windows/contrib/checkSummaryWin.htm > > you will see which are unavailable as Windows binaries and why. More can > be installed from the sources but do not pass R CMD check for Uwe (or in > most cases for anyone else: see the other CRAN summaries). > > This is the 'alpha' period, and we are waiting for updates on quite a > number of packages (especially ones that use S4 methods). However, R > 2.4.0 is not even in feature freeze yet, and it is quite possible that > packages will need to be reinstalled again prior to release. Currently, the main problems with many packages are missing *recent* binaries (after the latest S4 changes) of BioC packages, hence many dependencies may not be working. I do not want to compile the whole BioC repository as well. Uwe > On Mon, 11 Sep 2006, Richard M. Heiberger wrote: > >> I just downloaded the windows version >> R version 2.4.0 alpha (2006-09-05 r39134) >> >> 1. When I downloaded the packages, the following two were not found. >>> utils:::menuInstallPkgs() >> --- Please select a CRAN mirror for use in this session --- >> dependency ''fCalendar'' is not available >> >> dependency ''SparseM'' is not available >> >> I am not sure which other packages depend on these. >> >> >> 2. Of the others, several didn't install cleanly >> >> package 'mlbench' successfully unpacked and MD5 sums checked >> Warning: unable to move temporary installation 'C:\Program Files\R\R- >> 2.4.0alpha\library\file41bb5af1\mlbench' to 'C:\Program >> Files\R\R-2.4.0alpha\library\mlbench' >> package 'tseries' successfully unpacked and MD5 sums checked >> Warning: unable to move temporary installation 'C:\Program >> Files\R\R-2.4.0alpha\library\file305e124 >> \tseries' to 'C:\Program Files\R\R-2.4.0alpha\library\tseries' >> package 'DAAG' successfully unpacked and MD5 sums checked >> Warning: unable to move temporary installation 'C:\Program Files\R\R- >> 2.4.0alpha\library\file491c440d\DAAG' to 'C:\Program >> Files\R\R-2.4.0alpha\library\DAAG' >> package 'acepack' successfully unpacked and MD5 sums checked >> Warning: unable to move temporary installation 'C:\Program Files\R\R- >> 2.4.0alpha\library\file767d7a5a\acepack' to 'C:\Program >> Files\R\R-2.4.0alpha\library\acepack' >> package 'rcom' successfully unpacked and MD5 sums checked >> Warning: unable to move temporary installation 'C:\Program Files\R\R- >> 2.4.0alpha\library\file58784b40\rcom' to 'C:\Program >> Files\R\R-2.4.0alpha\library\rcom' >> >> >> I reinstalled all five from the local zip files that were downloaded as part >> of the above >> installation, and four worked and one didn't. >> I needed to reinstall mlbench a third time and this time it worked. >> >> This type of problem frequently happens when I download a new version of R. > > This suggests problems with your local file system: it is definitely a > Windows rather than an R problem. > >> 3. rgl is still not working in Windows >> >> package 'rgl' successfully unpacked and MD5 sums checked >> >>> library(rgl) >> Error in dyn.load(x, as.logical(local), as.logical(now)) : >> unable to load shared library >> 'C:/PROGRA~1/R/R-24~1.0AL/library/rgl/libs/rgl.dll': >> LoadLibrary failure: The specified procedure could not be found. >> >> Error: package/namespace load failed for 'rgl' >> >> Therefore the Rcmdr 3-d graphics isn't working. >> >> >> Rich >> >> __ >> 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] R Citation through time
> On Tue, 12 Sep 2006 07:53:52 +0200, > Gregor Gorjanc (GG) wrote: > Hello! > I keep my local bib file and up to now I had entry > @Manual{R:2003, > title = {R: A Language and Environment for Statistical Computing}, > author = {{R Development Core Team}}, > organization = {R Foundation for Statistical Computing}, > address = {Vienna, Austria}, > year = {2005}, > note = {{ISBN} 3-900051-00-3}, > url = {http://www.R-project.org}, > } > With recent versions ISBN changed to 3-900051-07-0. It changed with 2.0.0, which is not that recent ... > Now I wonder if there is any canonical way to refer to R without > the need to change R entry over and over. It would probably be the > best just to add new entry for "new version" for R. Now the > question is what is new version or when does ISBN number change? The ISBN changes with every major version of R, i.e., it will change next when 3.0.0 is released. We are already stretching the ISBN rules to the limit (on the no-change-side) with that policy, and the reason is exactly to make the reference more stable. But with a major release we really need to assign a new ISBN. Best, Fritz __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Failure to build home-made package on WINDOWS 2000 professional
Thank you for the interest in my problem. >From the questions I see I forgot to provide some vital information, for which I am sorry. Based on the question Uwe Ligges, I scrutinized my PATH settings and saw that my system administrators included a reference to a Cygwin installation (which caused problems). Secondly my PATH contained NETBIOS mounted shares (e.g. \\sever\path) and directories containing whitespace. When I remove those also from my path (converting the whitespace- containing paths to the corresponding DOS names), I was able to compile the software based on Duncan Murdoch's instructions Thank you all for your interest and time, kind regards, Joost Schalken miguel manese wrote: > Maybe you're doing bash > > . script.sh > > (i.e. source the script) ? > > M. Manese > > On 9/12/06, Uwe Ligges <[EMAIL PROTECTED]> wrote: >> >> >> Joost Schalken wrote: >> > Dear all, >> > >> > I am trying to build a home-made package (log2html) to >> > log R output to an HTML file. The package can be build >> > successfully under Solaris, however I am unable to build >> > the system under Windows 2000 Professional. >> > >> > I read (and tried to follow to the letter) Duncan Murdoch's >> > "Building R for Windows" (http://www.murdoch-sutherland.com/Rtools/), >> > in combination with the newest version of R (2.3.1), yet when >> > doing this I receive the following message while compiling the >> > system: >> > >> > > R CMD check log2html >> > * checking for working latex ...latex: not found NO >> > * using log directory 'D:/tmp/log2html.Rcheck' >> > * using Version 2.3.1 (2006-06-01) >> > * checking for file 'log2html/DESCRIPTION' ... OK >> > * checking extension type ... Package >> > * this is package 'log2html' version '1.0-1' >> > * checking package dependencies ... OK >> > * checking if this is a source package ... OK >> > * checking whether package 'log2html' can be installed ... ERROR >> > Installation failed. >> > See 'D:/tmp/log2html.Rcheck/00install.out' for details. >> > >> > In the file D:/tmp/log2html.Rcheck/00install.out are the following >> > messages: >> > installing R.css in H:/tmp/log2html.Rcheck >> > '.' is not recognized as an internal or external command, operable >> > program or batch file. >> > '.' is not recognized as an internal or external command, operable >> > program or batch file. >> > '.' is not recognized as an internal or external command, operable >> > program or batch file. >> > make: *** /log2html: No such file or directory. Stop. >> > make: *** [pkg-log2html] Error 2 >> > *** Installation of log2html failed *** >> > Removing 'D:/tmp/log2html.Rcheck/log2html' >> > >> > Can anybody provide me with hints how to solve this >> > problem? >> >> Can you tell us your exact PATH settings, please? >> >> Uwe Ligges >> >> > Kind regards, >> > >> > Joost Schalken >> > >> > __ >> > 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 >> D:\tmp>R CMD check log2html * checking for working latex ... 'sh' is not recognized as an internal or external command, operable program or batch file. NO * using log directory 'D:/tmp/log2html.Rcheck' 'sh' is not recognized as an internal or external command, operable program or batch file. * using * checking for file 'log2html/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'log2html' version '1.0-1' * checking package dependencies ... 'sh' is not recognized as an internal or external command, operable program or batch file. OK * checking if this is a source package ... OK * checking whether package 'log2html' can be installed ... 'sh' is not recognized as an internal or external command, operable program or batch file. Error: cannot open file 'D:/tmp/log2html.Rcheck/00install.out' for reading__ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] problems in installing packages with R version 2.4.0 alpha (2006-09-05 r39134)
> "MM" == Martin Maechler <[EMAIL PROTECTED]> > on Tue, 12 Sep 2006 08:56:41 +0200 writes: > "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> > on Mon, 11 Sep 2006 22:25:58 +0100 (BST) writes: BDR> At least some of this will go away if you use a current BDR> version of 2.4.0 alpha rather than one that is a week BDR> old (as the posting guide does ask). We are now at BDR> r39258, and some of those binary packages were built BDR> against a substantially later version of 2.4.0 alpha. BDR> [] MM> Still "Thank you, Rich!" for running R-alpha and your report. MM> We are grateful for everyone who does use R-alpha and reports MM> "unusual" findings, even if some of them are already known to MM> the R developers. I have really failed to add the following: The fact that you get *binary* windows packages for R-alpha **at all** is already remarkable and only the result of extensive, persistent and diligent work by Uwe Ligges and Brian Ripley. They shall be thanked thoroughly hereby! [ For alpha-testing, I'd typically expect anyone to build anything from the sources -- which of course is quite a requirement for users of R for windows. ] Martin __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Memory problems with a custom R package
Hi everyone, I have been attempting to build a very simple R package interfacing with some very simple C++ code. Everything I try though results in the function working but on return it produces a memory error. Here is the output: ***OUTPUT*** > library(MyPackage) > hello(); *** caught segfault *** address 0x3, cause 'memory not mapped' **END OUTPUT* I have read that some time this occurs because it cannot find the function in the shared library but I have tested this theory with a simple text message and this is displayed but again the memory error occurs. The C++ code has been reduced to the simplest possible: *** helloworld.h extern "C" void helloworld(void); *** helloworld.cpp #include #include "helloworld.h" void helloworld(void) { // This was my test line that was displayed as described above. // std::cout << "My first R Package Test." << std::endl; } I also wrote an R wrapper called hello as follows: *** helloworld.R hello <- function() { .Call("helloworld", PACKAGE="MyPackage"); } The namespaces file (NAMESPACE) is as follows: useDynLib(MyPackage) export(hello) I have compared mine against other package sources available that do the same thing and cannot find the key difference. Thank you for your help in advance, Tom __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Memory problems with a custom R package
On Tue, 12 Sep 2006, Tom McCallum wrote: > Hi everyone, > > I have been attempting to build a very simple R package interfacing with > some very simple C++ code. Everything I try though results in the > function working but on return it produces a memory error. Here is the > output: > > ***OUTPUT*** > > > library(MyPackage) > > hello(); > > *** caught segfault *** > address 0x3, cause 'memory not mapped' > > **END OUTPUT* > > I have read that some time this occurs because it cannot find the function > in the shared library but I have tested this theory with a simple text Where did you read that? It is not true: you get an R error message in that case. > message and this is displayed but again the memory error occurs. > > The C++ code has been reduced to the simplest possible: > > *** helloworld.h > > extern "C" void helloworld(void); > > *** helloworld.cpp > > #include > #include "helloworld.h" > > void helloworld(void) { > //This was my test line that was displayed as described above. > // std::cout << "My first R Package Test." << std::endl; > } > But that is the problem: .Call requires a SEXP return value from the entry point it calls. > I also wrote an R wrapper called hello as follows: > > *** helloworld.R > > hello <- function() > { > .Call("helloworld", PACKAGE="MyPackage"); > } > > The namespaces file (NAMESPACE) is as follows: > > useDynLib(MyPackage) > export(hello) > > I have compared mine against other package sources available that do the > same thing and cannot find the key difference. > > Thank you for your help in advance, > > Tom > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Memory problems with a custom R package
compiler/platform? I did this: R CMD SHLIB helloworld.cpp Then this in R: > dyn.load("helloworld.so") > .Call("helloworld") and it doesn't segfault. (x86_64 linux with 32-bit R). Tom McCallum wrote: > Hi everyone, > > I have been attempting to build a very simple R package interfacing with > some very simple C++ code. Everything I try though results in the > function working but on return it produces a memory error. Here is the > output: > > ***OUTPUT*** > >> library(MyPackage) >> hello(); > > *** caught segfault *** > address 0x3, cause 'memory not mapped' > > **END OUTPUT* > > I have read that some time this occurs because it cannot find the function > in the shared library but I have tested this theory with a simple text > message and this is displayed but again the memory error occurs. > > The C++ code has been reduced to the simplest possible: > > *** helloworld.h > > extern "C" void helloworld(void); > > *** helloworld.cpp > > #include > #include "helloworld.h" > > void helloworld(void) { > //This was my test line that was displayed as described above. > // std::cout << "My first R Package Test." << std::endl; > } > > I also wrote an R wrapper called hello as follows: > > *** helloworld.R > > hello <- function() > { > .Call("helloworld", PACKAGE="MyPackage"); > } > > The namespaces file (NAMESPACE) is as follows: > > useDynLib(MyPackage) > export(hello) > > I have compared mine against other package sources available that do the > same thing and cannot find the key difference. > > Thank you for your help in advance, > > Tom > > __ > 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] R Citation through time
Friedrich Leisch wrote: >> On Tue, 12 Sep 2006 07:53:52 +0200, >> Gregor Gorjanc (GG) wrote: > > > Hello! > > I keep my local bib file and up to now I had entry > > > @Manual{R:2003, > > title = {R: A Language and Environment for Statistical Computing}, > > author = {{R Development Core Team}}, > > organization = {R Foundation for Statistical Computing}, > > address = {Vienna, Austria}, > > year = {2005}, > > note = {{ISBN} 3-900051-00-3}, > > url = {http://www.R-project.org}, > > } > > > With recent versions ISBN changed to 3-900051-07-0. > > It changed with 2.0.0, which is not that recent ... > > > Now I wonder if there is any canonical way to refer to R without > > the need to change R entry over and over. It would probably be the > > best just to add new entry for "new version" for R. Now the > > question is what is new version or when does ISBN number change? > > The ISBN changes with every major version of R, i.e., it will change > next when 3.0.0 is released. We are already stretching the ISBN rules > to the limit (on the no-change-side) with that policy, and the > reason is exactly to make the reference more stable. But with a major > release we really need to assign a new ISBN. Thank you for this clarifications. As indicated ISBN is not changing very often and I can live with couple of BibTeX entries for R. Thanks! -- Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana PhD student Biotechnical Faculty Zootechnical Department URI: http://www.bfro.uni-lj.si/MR/ggorjan Groblje 3 mail: gregor.gorjanc bfro.uni-lj.si SI-1230 Domzale tel: +386 (0)1 72 17 861 Slovenia, Europefax: +386 (0)1 72 17 888 -- "One must learn by doing the thing; for though you think you know it, you have no certainty until you try." Sophocles ~ 450 B.C. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] mcnemar.test helpfile (PR#9220)
Full_Name: Chris Andrews Version: 2.3.1 OS: Windows Submission from: (NULL) (128.205.253.147) ?mcnemar.test ends with an example: ## Agresti (1990), p. 350. ## Presidential Approval Ratings. ## Approval of the President's performance in office in two surveys, ## one month apart, for a random sample of 1600 voting-age Americans. Performance <- matrix(c(794, 86, 150, 570), nr = 2, dimnames = list("1st Survey" = c("Approve", "Disapprove"), "2nd Survey" = c("Approve", "Disapprove"))) Performance mcnemar.test(Performance) ## => very strong association between the two successive ratings The example runs fine. The final statement ("very strong association between the two successive ratings") is true. But they are unrelated. McNemar's test is a test of marginal homogeneity. The conclusion should be that opinion has changed. The marginal distributions are different. The approval rating has dropped from 59% to 55% (p=4e-5). __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] problems in installing packages with R version 2.4.0 alpha (2006-09-05 r39134)
Uwe Ligges <[EMAIL PROTECTED]> writes: > Currently, the main problems with many packages are missing *recent* > binaries (after the latest S4 changes) of BioC packages, hence many > dependencies may not be working. I do not want to compile the whole BioC > repository as well. The Bioconductor build systems have been updated to a recent R 2.4.0 alpha and binary packages should be available Real Soon Now. + seth __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] segfault in plot(x, y, col = aFactor) (PR#9221)
After the following commands (issued just after starting R) set.seed(1) n <- 600 x <- rnorm(n) y <- rnorm(n) aFactor <- factor(rep(1:5, length = n)) plot(x, y, col = aFactor) R prints *** caught segfault *** address 0x10, cause 'memory not mapped' Segmentation fault and dies. (Yes, I know that using a factor as `col' is wrong; I discovered this by a mistake. :-) Substituting "aFactor <- factor(rep(1:5, length = n))" with "aFactor <- rep(1:5, length = n)" (obviously) works as expected. When n is smaller, for instance 400, no seg.fault seems to happen. I also tested this on R 2.3.1 (that's actually where I discovered it :-), and the same thing happens there. --please do not edit the information below-- Version: platform = x86_64-unknown-linux-gnu arch = x86_64 os = linux-gnu system = x86_64, linux-gnu status = alpha major = 2 minor = 4.0 year = 2006 month = 09 day = 11 svn rev = 39258 language = R version.string = R version 2.4.0 alpha (2006-09-11 r39258) Locale: LC_CTYPE=no_NO.UTF-8;LC_NUMERIC=C;LC_TIME=no_NO.UTF-8;LC_COLLATE=no_NO.UTF-8;LC_MONETARY=no_NO.UTF-8;LC_MESSAGES=no_NO.UTF-8;LC_PAPER=no_NO.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=no_NO.UTF-8;LC_IDENTIFICATION=C Search Path: .GlobalEnv, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base -- Bjørn-Helge Mevik __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] segfault in plot(x, y, col = aFactor) (PR#9221)
Thank you, Bjørn-Helge. A shorter version is plot(1:500, col = gl(2,250)) Interestingly, with much shorter vectors of length (n), the correct warning is produced (n times). And once that has happened, you can use longer vectors without any problem. As you said ``issued just after starting R'' seems quite relevant. When run in 'R -d gdb', the backtrace ("bt") seems to indicate that the problem is happening during the (C-level) warning() call. Martin __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] segfault in plot(x, y, col = aFactor) (PR#9221)
valgrind solves this: > plot(x, y, col = aFactor) ==10339== Invalid write of size 4 ==10339==at 0x4F70CE: Rf_FixupCol (plot.c:354) ==10339==by 0x4FC124: do_plot_xy (plot.c:1554) ==10339==by 0x4D75DC: do_internal (names.c:1094) ==10339==by 0x499C05: Rf_eval (eval.c:431) ==10339==by 0x49A365: Rf_applyClosure (eval.c:614) ==10339==by 0x499E1F: Rf_eval (eval.c:455) ==10339==by 0x49B869: do_begin (eval.c:1107) ==10339==by 0x499C05: Rf_eval (eval.c:431) ==10339==by 0x49A365: Rf_applyClosure (eval.c:614) ==10339==by 0x4D7B47: applyMethod (objects.c:121) ==10339==by 0x4D8505: Rf_usemethod (objects.c:307) ==10339==by 0x4D8825: do_usemethod (objects.c:391) ==10339== Address 0x9898130 is 224 bytes inside a block of size 2,440 free'd ==10339==at 0x49057C8: free (vg_replace_malloc.c:233) It needs protection in FixupCol because warning() allocates. On Tue, 12 Sep 2006, [EMAIL PROTECTED] wrote: > Thank you, Bjørn-Helge. > A shorter version is >plot(1:500, col = gl(2,250)) > > Interestingly, with much shorter vectors of length (n), the correct warning > is produced (n times). > And once that has happened, you can use longer vectors without > any problem. > > As you said ``issued just after starting R'' > seems quite relevant. > > When run in 'R -d gdb', the backtrace ("bt") seems to indicate > that the problem is happening during the (C-level) warning() call. > > Martin > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595__ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R Citation through time
Forgive me for being naive, but I have not seen any reference where the ISBN was required. The apa style that I use does not require the ISBN. Best, Ioannis = On Tue, Sep 12, 2006 16:22, Gregor Gorjanc wrote: > Friedrich Leisch wrote: >>> On Tue, 12 Sep 2006 07:53:52 +0200, >>> Gregor Gorjanc (GG) wrote: >> >> > Hello! >> > I keep my local bib file and up to now I had entry >> >> > @Manual{R:2003, >> > title = {R: A Language and Environment for Statistical >> Computing}, >> > author = {{R Development Core Team}}, >> > organization = {R Foundation for Statistical Computing}, >> > address = {Vienna, Austria}, >> > year = {2005}, >> > note = {{ISBN} 3-900051-00-3}, >> > url = {http://www.R-project.org}, >> > } >> >> > With recent versions ISBN changed to 3-900051-07-0. >> >> It changed with 2.0.0, which is not that recent ... >> >> > Now I wonder if there is any canonical way to refer to R without >> > the need to change R entry over and over. It would probably be the >> > best just to add new entry for "new version" for R. Now the >> > question is what is new version or when does ISBN number change? >> >> The ISBN changes with every major version of R, i.e., it will change >> next when 3.0.0 is released. We are already stretching the ISBN rules >> to the limit (on the no-change-side) with that policy, and the >> reason is exactly to make the reference more stable. But with a major >> release we really need to assign a new ISBN. > > Thank you for this clarifications. As indicated ISBN is not changing > very often and I can live with couple of BibTeX entries for R. > > Thanks! > > -- > Lep pozdrav / With regards, > Gregor Gorjanc > > -- > University of Ljubljana PhD student > Biotechnical Faculty > Zootechnical Department URI: http://www.bfro.uni-lj.si/MR/ggorjan > Groblje 3 mail: gregor.gorjanc bfro.uni-lj.si > > SI-1230 Domzale tel: +386 (0)1 72 17 861 > Slovenia, Europefax: +386 (0)1 72 17 888 > > -- > "One must learn by doing the thing; for though you think you know it, > you have no certainty until you try." Sophocles ~ 450 B.C. > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Ioannis C. Dimakos, Ph.D. University of Patras Department of Elementary Education Patras, GR-26500 GREECE http://www.elemedu.upatras.gr/dimakos/ http://thedailyblahblah.blogspot.com/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] unexpected behaviour when defining a function
On 9/11/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Mon, 11 Sep 2006, Deepayan Sarkar wrote: > > > Hi, > > > > I know S manuals used to warn against using the same names for a > > variable and a function, but I have never seen that cause problems in > > R, so I usually don't pay much attention to it. > > But in this case you have a promise. (BTW, it can still cause problems in > R, hence the following NEWS item for 2.4.0: > > Lookup for S3 methods is confined to functions: previously a > non-function 'fun.class' could have masked a function of the > same name. > ) > > Note that you do have to look at an object to find out if it is a > function, and that means forcing promises, the problem here. > > > Which is why the following behaviour came as a surprise: > > > > > bar <- function() 1 > > > foo <- function(bar = bar()) { > > + bar > > + } > > > foo(9) > > [1] 9 > > > foo() > > Error in foo() : recursive default argument reference > > > > Exactly what rule am I violating here? > > That an argument default value cannot refer to the argument. > > This is an argument with a default value that is relying on lazy > evaluation. When you come to evaluate 'bar' it is a promise with value > bar(). Evaluating that value looks up 'bar' from the evaluation frame of > foo() and the first candidate it finds is the argument it is the process > of evaluating, hence the message. > > > The following gives a slightly different error, but I assume it has a > > similar origin: > > > > bar <- function() 1 > > foo <- function(bar) { > > if (missing(bar)) bar <- bar() > > bar > > } > > foo() > > It says > > > Error in foo() : argument "bar" is missing, with no default > > and that is caused by bar <- bar(): it is looking for argument bar (to > see if it is a function which can be called) and that argument has no > default. (I would have thought that one was clear enough.) It is clear enough once I think about it (I was probably hoping that it would continue searching, but that does not make sense). Thanks for the explanation. Deepayan > > -- > Brian D. Ripley, [EMAIL PROTECTED] > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UKFax: +44 1865 272595 > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R Citation through time
Ioannis Dimakos wrote: > Forgive me for being naive, > > but I have not seen any reference where the ISBN was required. The apa > style that I use does not require the ISBN. > > Best, > > Ioannis You can put that part in note field as it is done in output of citation() function. -- Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana PhD student Biotechnical Faculty Zootechnical Department URI: http://www.bfro.uni-lj.si/MR/ggorjan Groblje 3 mail: gregor.gorjanc bfro.uni-lj.si SI-1230 Domzale tel: +386 (0)1 72 17 861 Slovenia, Europefax: +386 (0)1 72 17 888 -- "One must learn by doing the thing; for though you think you know it, you have no certainty until you try." Sophocles ~ 450 B.C. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] make check error (PR#9222)
Full_Name: Version: 3.2.1 OS: RHEL AS 4.0 update 4 Submission from: (NULL) (151.152.101.44) Error in make check: running code in 'reg-tests-1.R' .../bin/sh: line 1: 9538 Segmentation fault LC_ALL=C SRCDIR=. R_DEFAULT_PACKAGES= ../bin/R --vanilla reg-tests-1.Rout 2>&1 make[3]: *** [reg-tests-1.Rout] Error 1 make[3]: Leaving directory `/home/xwu/R-2.3.1/tests' make[2]: *** [test-Reg] Error 2 make[2]: Leaving directory `/home/xwu/R-2.3.1/tests' make[1]: *** [test-all-basics] Error 1 make[1]: Leaving directory `/home/xwu/R-2.3.1/tests' make: *** [check] Error 2 At the end of the reg-tests-1.Rout.fail file: *** caught segfault *** address (nil), cause 'unknown' Traceback: 1: .Fortran("rg", n, n, x, values = dbl.n, ivalues = dbl.n, !only.values, vectors = x, integer(n), dbl.n, ierr = integer(1), PACKAGE = "base") 2: eigen(Gm, EISPACK = TRUE) aborting ... Thanks. Note: I tried 3.2.0 and got the same error. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] S4 Method dispatch in recent 2.4.0alpha
Your suggestions worked ok in the example, but in my case there is yet another package that implements a plot method. Now the plotting from within the package works, but plotting from outside the package, on the console, gives an error as if plot.default is invoked. > class(myplot) [1] "gt.barplot" attr(,"package") [1] "globaltest" > plot(myplot) Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ Rgraphviz implements a plot method on 2 classes: graph and Ragraph multtest implements a plot method on 1 class: MTP globaltest, the package i'm working on, depends on multtest, and suggests Rgraphviz. Class gt.barplot implements a plot method the output of showMethods("plot") > showMethods("plot") Function: plot, (package graphics) x="ANY" x="graph" x="gt.barplot" x="MTP" x="Ragraph" Rgraphviz has a proper NAMESPACE and I created one for multtest that imports plot from graphics, and exports plot as a method, because they are not dependent on each other that does seem ok. In globaltest I import the plot method from multtest. How to deal with this. > sessionInfo() R version 2.4.0 alpha (2006-09-11 r39258) i386-pc-mingw32 locale: LC_COLLATE=Dutch_Netherlands.1252;LC_CTYPE=Dutch_Netherlands.1252;LC_MONETARY=Dutch_Netherlands.1252;LC_NUMERIC=C;LC_TIME=Dutch_Netherlands.1252 attached base packages: [1] "splines" "tools" "methods" "stats" "graphics" "grDevices" [7] "utils" "datasets" "base" other attached packages: Rgraphviz geneplotter GOstatsCategoryhgu95av2 genefilter "1.11.10""1.11.8""1.7.11" "1.5.9""1.13.0""1.11.8" RBGLannotate graph Ruuid GOKEGG "1.9.9""1.11.5" "1.11.14""1.11.2""1.13.0""1.13.0" hu6800 globaltestmulttestsurvival vsn golubEsets "1.13.0" "4.3.5""1.11.2" "2.28""1.11.2" "1.3.1" Biobase "1.11.34" === John Chambers wrote: > Good example. > >The basic problem is in the NAMESPACE file: > >importFrom(graphics, plot) > >But the version of plot() in the graphics package is not a generic function. >Therefore, when your mpplot() calls it there is no >method dispatch. > >You need to import the generic version of plot() from minipkg2 (notice that >there's a message about creating a new generic for >plot() when you install >minipkg2). > >The line in the NAMESPACE file should be: > >importFrom(minipkg2, plot) > >In your mini-example, there are some additional steps needed, not directly >related to the problem & possibly not true in the >real example. > >1. minipkg2 also needs a NAMESPACE, in which it imports from methods and >graphics and exports plot and the class mp2.plot >(example attached). > >2. Highly recommended though maybe not required here is to use some form of >saved image, e.g. by including "LazyLoad:yes" in >the two DESCRIPTION files. > >John Oosting, J. (PATH) wrote: I use 2 packages that both implement a S4 plot method, where one package depends on the other (the bioconductor package globaltest which depends on multtest). When the plot method is used from within the package, it seems the default plot method is used, and an error is generated. When the method is invoked from the console, the plot is created correctly. I have reproduced this with 2 small packages (minipkg and minipkg2) implementing just this part. I've seen a thread about a similar problem, but that seemed mostly due to already installed packages not handling the new S4 stuff. mpplot() is a function that creates a class instance and (usually) invokes the plot immediately. When the dependency on minipkg2 is removed from the DESCRIPTION file the first call to mpplot() gives no error and shows the plot. Jan Oosting library(minipkg) Loading required package: minipkg2 Creating a new generic function for 'plot' in 'minipkg2' mpplot(1:10) Error in as.vector(x, "double") : cannot coerce to vector plot(mpplot(1:10,plot=FALSE)) # this shows a proper plot showMethods("plot") Function: plot, (package graphics) x="ANY" x="mp.plot" x="mp2.plot" sessionInfo() R version 2.4.0 Under development (unstable) (2006-09-04 r39086) i386-pc-mingw32 locale: LC_COLLATE=Dutch_Netherlands.1252;LC_CTYPE=Dutch_Netherlands.1252;LC_MON ETARY=Dutch_Netherlands.1252;LC_NUMERIC=C;LC_TIME=Dutch_Netherlands.1252 attached base packages: [1] "methods" "stats" "graphics" "grDevic