Spencer Graves
2020-Mar-17 05:47 UTC
[Rd] ":::" operator doesn't work with data object Ecdat:::Crime
????? The ":::" operator doesn't work for me with "Ecdat:::Crime" on either macOS 10.15.3 or Windows 10. ????? A different but related issue is that "plm::Crime" says "Error: 'Crime' is not an exported object from 'namespace:plm'", even though "library(plm); data(Crime); Crime" works.? I would naively think a user should be able to compare "Crime" objects documented in different packages using the "::" and ":::" operators, even if a package maintainer chooses not to "export" data objects. ????? What do you think? ????? Thanks, ????? Spencer Graves *** The following is from my Mac;? I could give you the comparable results from Windows 10 if you want it. > dim(Ecdat::Crime) [1] 630? 24 > Ecdat:::Crime Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : ? object 'Crime' not found > sessionInfo() R version 3.6.3 (2020-02-29) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Catalina 10.15.3 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats???? graphics? grDevices utils???? datasets [6] methods?? base loaded via a namespace (and not attached): ?[1] Rcpp_1.0.3???????? lattice_0.20-40 ?[3] mvtnorm_1.1-0????? BMA_3.18.12 ?[5] Ecdat_0.3-7??????? rrcov_1.5-2 ?[7] MASS_7.3-51.5????? leaps_3.1 ?[9] grid_3.6.3???????? pcaPP_1.9-73 [11] stats4_3.6.3?????? TeachingDemos_2.10 [13] Ecfun_0.2-4??????? robustbase_0.93-5 [15] xml2_1.2.5???????? Matrix_1.2-18 [17] splines_3.6.3????? tools_3.6.3 [19] DEoptimR_1.0-8???? jpeg_0.1-8.1 [21] survival_3.1-11??? compiler_3.6.3 [23] inline_0.3.15????? fda_2.4.8.1 [1] The six "Crime" objects I found were in the following packages: Ecdat,? BSDA, plm, mosaicModel, statisticalModeling, and gpk.
Abby Spurdle
2020-Mar-17 08:22 UTC
[Rd] ":::" operator doesn't work with data object Ecdat:::Crime
Crime? (Macavity, Macavity, ..., and when you reach the scene of crime Macavity's not there...) I suspect your data objects are like Macavity, they're not there. I found this in the R Internals 1.17. Lazy-load databases are loaded into the exports for a package, but not into the namespace environment itself. Thus they are visible when the package is attached, and also via the :: operator. This was a deliberate design decision... The manual is not explicit about the converse, but implies (I think) that the converse is true. (i.e. Non-lazyloaded datasets are not supposed to available via this mechanism). I didn't check your examples. Are your examples lazyloaded? And are they any different from other similar packages/datasets?> A different but related issue is that "plm::Crime" says "Error: > 'Crime' is not an exported object from 'namespace:plm'", even though > "library(plm); data(Crime); Crime" works. I would naively think a user > should be able to compare "Crime" objects documented in different > packages using the "::" and ":::" operators, even if a package > maintainer chooses not to "export" data objects. > What do you think?