vincent chouraki
2011-Jul-01 10:52 UTC
[R] methods package not loaded by default when using Rscript in R2.13
Dear all, As the object of this mail suggests, the methods package is not loaded by default in R2.13 when using Rscript whereas it is loaded when using an interactive session. An example with the metafor package : library(metafor) example(addpoly.rma) this works in an interaction R shell, but put it in a .R file and use it with Rscript, it won't work until you added library(methods) One of my colleague had the same issue with other custom R functions (work in 2.12, not anymore in 2.13 because of the same behavior) Is this something that was planned or a bug? Best Vincent ################################################################ My session info for the interactive R ################################################################> sessionInfo()R version 2.13.0 (2011-04-13) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=fr_FR.utf8 LC_NUMERIC=C [3] LC_TIME=fr_FR.utf8 LC_COLLATE=fr_FR.utf8 [5] LC_MONETARY=C LC_MESSAGES=fr_FR.utf8 [7] LC_PAPER=fr_FR.utf8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=fr_FR.utf8 LC_IDENTIFICATION=C attached base packages: [1] grid stats graphics grDevices utils datasets methods [8] base other attached packages: [1] metafor_1.6-0 Formula_1.0-0 nlme_3.1-101 gwa_0.0-1 [5] genetics_1.3.6 mvtnorm_0.9-9991 MASS_7.3-13 gtools_2.6.2 [9] gdata_2.8.2 combinat_0.0-8 rmeta_2.16 loaded via a namespace (and not attached): [1] lattice_0.19-26 tools_2.13.0 ############################################################# the same from Rscript ############################################################# R version 2.13.0 (2011-04-13) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=fr_FR.utf8 LC_NUMERIC=C [3] LC_TIME=fr_FR.utf8 LC_COLLATE=fr_FR.utf8 [5] LC_MONETARY=C LC_MESSAGES=fr_FR.utf8 [7] LC_PAPER=fr_FR.utf8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=fr_FR.utf8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets base other attached packages: [1] metafor_1.6-0 Formula_1.0-0 nlme_3.1-101 loaded via a namespace (and not attached): [1] grid_2.13.0 lattice_0.19-26 ________________________________ Dr Vincent Chouraki Assistant hospitalier universitaire Service d'épidémiologie régional CHRU de Lille, France [[alternative HTML version deleted]]
Berend Hasselman
2011-Jul-01 11:38 UTC
[R] methods package not loaded by default when using Rscript in R2.13
Vincent Chouraki wrote:> > Dear all, > > As the object of this mail suggests, the methods package is not loaded by > default in R2.13 when using Rscript whereas it is loaded when using an > interactive session. >?Rscript will tell you why and what you could do to change the default. Berend -- View this message in context: http://r.789695.n4.nabble.com/methods-package-not-loaded-by-default-when-using-Rscript-in-R2-13-tp3637937p3638002.html Sent from the R help mailing list archive at Nabble.com.
peter dalgaard
2011-Jul-01 11:41 UTC
[R] methods package not loaded by default when using Rscript in R2.13
On Jul 1, 2011, at 12:52 , vincent chouraki wrote:> Dear all, > > As the object of this mail suggests, the methods package is not loaded by > default in R2.13 when using Rscript whereas it is loaded when using an > interactive session. > > An example with the metafor package : > > library(metafor) > example(addpoly.rma) > > this works in an interaction R shell, but put it in a .R file and use it with > Rscript, it won't work until you added > > library(methods) > > One of my colleague had the same issue with other custom R functions (work in > 2.12, not anymore in 2.13 because of the same behavior) > > Is this something that was planned or a bug?It's intentional. See help(Rscript) for the reason and the remedies. -pd -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
Possibly Parallel Threads
- [R 2.12] install.packages() with no lib argument does not work
- [Hmisc] latex() with ctable=T inserting unwanted empty line in .tex file when used on summary.formula(method="reverse") object
- "by" function "half-working" when used in a custom function
- meta-analysis normal quantile plot metafor
- R versions and PostScript files