pinard at progiciels-bpi.ca
2006-Mar-28 01:00 UTC
[Rd] Error once having applied (PR#8718)
Hi, people. Here is a transcript of a "R --vanilla" session: ======================================================================> R : Copyright 2005, The R Foundation for Statistical Computing Version 2.2.1 (2005-12-20 r36812) ISBN 3-900051-07-0 R est un logiciel libre livr?? sans AUCUNE GARANTIE. Vous pouvez le redistribuer sous certaines conditions. Tapez 'license()' ou 'licence()' pour plus de d??tails. R est un projet collaboratif avec de nombreux contributeurs. Tapez 'contributors()' pour plus d'information et 'citation()' pour la fa??on de le citer dans les publications. Tapez 'demo()' pour des d??monstrations, 'help()' pour l'aide en ligne ou 'help.start()' pour obtenir l'aide au format HTML. Tapez 'q()' pour quitter R.> z = data.frame(a=0:9, b=10:19) > apply(z, 1, sum)1 2 3 4 5 6 7 8 9 10 10 12 14 16 18 20 22 24 26 28> apply(z, 1, '$', 'a')NULL> apply(z, 1, sum)Erreur dans sum(..., na.rm = na.rm) : 'mode' de l'argument incorrect ======================================================================< There are three explicit calls to "apply", one would expect the first and the third to yield similar results. They do indeed, if the second "apply" is not executed, or if '$' gets replaced by '[[' within it. So the second "apply", as written, may be hurting the R interpreter. --please do not edit the information below-- Version: platform = i686-pc-linux-gnu arch = i686 os = linux-gnu system = i686, linux-gnu status = major = 2 minor = 2.1 year = 2005 month = 12 day = 20 svn rev = 36812 language = R Locale: LC_CTYPE=fr_CA.UTF-8;LC_NUMERIC=C;LC_TIME=fr_CA.UTF-8;LC_COLLATE=fr_CA.UTF-8;LC_MONETARY=fr_CA.UTF-8;LC_MESSAGES=fr_CA.UTF-8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C Search Path: .GlobalEnv, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base
maechler at stat.math.ethz.ch
2006-Mar-28 10:05 UTC
[Rd] Error once having applied (PR#8718)
Merci, Fran?ois!>>>>> "FrPi" == Fran?ois Pinard <pinard at progiciels-bpi.ca> >>>>> on Tue, 28 Mar 2006 03:00:19 +0200 (CEST) writes:FrPi> Hi, people. Here is a transcript of a "R --vanilla" session: FrPi> ======================================================================> FrPi> R : Copyright 2005, The R Foundation for Statistical Computing FrPi> Version 2.2.1 (2005-12-20 r36812) .................... >> z = data.frame(a=0:9, b=10:19) >> apply(z, 1, sum) FrPi> 1 2 3 4 5 6 7 8 9 10 FrPi> 10 12 14 16 18 20 22 24 26 28 >> apply(z, 1, '$', 'a') FrPi> NULL >> apply(z, 1, sum) FrPi> Erreur dans sum(..., na.rm = na.rm) : 'mode' de l'argument incorrect FrPi> ======================================================================< FrPi> There are three explicit calls to "apply", one would expect the first FrPi> and the third to yield similar results. They do indeed, if the second FrPi> "apply" is not executed, or if '$' gets replaced by '[[' within it. So FrPi> the second "apply", as written, may be hurting the R interpreter. Indeed! 'z' itself is not changed; it's something else that's corrupted, since one can reproduce the bug by apply(data.frame(a=0:9, b=10:19), 1, sum) apply(data.frame(a=0:9, b=10:19), 1, "$", "a") apply(data.frame(a=0:9, b=10:19), 1, sum) ##-> error ... invalid 'mode' This also happens in "R-devel", since yesterday aka "2.3.0 alpha". Martin
Reasonably Related Threads
- How can I change the language back to english?
- Problem loading fAssets.
- R 2.11 on Ubuntu 9.10 does not complain abt unexisting objects
- I can't do it again on an other PC : R+RMySQL ->error loading dll
- Installing odesolve package of R under Ubuntu (Debian) Linux