While executing the following for linear regression the following error is thrown. The variables are numeric in the dataset.
dtsample2 <- read.csv("dtsample2.csv")
gt <- lm(Sales ~ Discount, data = dtsample2)
Error in lm(Sales ~ Discount, data = dtsample2) : unused argument
(data = dtsample2)
Please find the session info below.
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] tcltk stats4 grid splines stats graphics grDevices utils datasets methods
[11] base
other attached packages:
[1] RcmdrPlugin.FuzzyClust_1.1 FactoMineR_1.36 RcmdrPlugin.EZR_1.35
[4] Hmisc_4.0-3 Formula_1.2-2 xtable_1.8-2
[7] forecast_8.1 xts_0.10-0 zoo_1.8-0
[10] tseries_0.10-42 TeachingDemos_2.10 RcmdrPlugin.EcoVirtual_1.0
[13] EcoVirtual_1.0 RcmdrPlugin.EBM_1.0-10 epiR_0.9-87
[16] RcmdrPlugin.EACSPIR_0.2-2 reshape_0.8.6 nortest_1.0-4
[19] ez_4.4-0 abind_1.4-5 R2HTML_2.3.2
[22] RcmdrPlugin.doex_0.2.0 RcmdrPlugin.DoE_0.12-3 relimp_1.0-5
[25] DoE.wrapper_0.8-10 rsm_2.8 FrF2_1.7-2
[28] DoE.base_0.30 conf.design_2.0.0 RcmdrPlugin.depthTools_1.3
[31] depthTools_0.4 RcmdrPlugin.coin_1.0-22 multcomp_1.4-6
[34] TH.data_1.0-8 mvtnorm_1.0-6 coin_1.2-0
[37] survival_2.41-3 biclust_1.2.0 colorspace_1.3-2
[40] MASS_7.3-47 RcmdrPlugin.BCA_0.9-8 flexclust_1.3-4
[43] modeltools_0.2-21 lattice_0.20-35 BCA_0.9-3
[46] Rcmdr_2.3-2 RcmdrMisc_1.0-5 sandwich_2.3-4
[49] car_2.1-5 ggthemes_3.4.0 ggplot2_2.2.1
[52] e1071_1.6-8 dplyr_0.7.1 rJava_0.9-8
[55] ModelMetrics_1.1.0 lme4_1.1-13 arules_1.5-2
[58] Matrix_1.2-10 ROCR_1.0-7 gplots_3.0.1
[61] RSQLite_2.0
loaded via a namespace (and not attached):
[1] stringr_1.2.0 gdata_2.18.0 gtools_3.5.0
[4] bindrcpp_0.2 rlang_0.1.1 htmlTable_1.9
[7] iterators_1.0.8 mgcv_1.8-17 blob_1.1.0
[10] bitops_1.0-6 base64enc_0.1-3 quantreg_5.33
[13] reshape2_1.4.2 R6_2.2.2 bit_1.1-12
[16] clue_0.3-53 plyr_1.8.4 tkrplot_0.0-23
[19] stringi_1.1.5 tcltk2_1.2-11 BsMD_2013.0718
[22] rpart.plot_2.1.2 munsell_0.4.3 vcd_1.4-3
[25] MatrixModels_0.4-1 ggthemr_1.1.0 htmlwidgets_0.9
[28] leaps_3.0 quadprog_1.5-5 quantmod_0.4-10
[31] pbkrtest_0.4-7 DBI_0.7 memoise_1.1.0
[34] bindr_0.1 foreign_0.8-69 pkgconfig_2.0.1
[37] BiasedUrn_1.07 tools_3.4.1 acepack_1.4.1
[40] SparseM_1.77 clv_0.3-2.1 cluster_2.0.6
[43] compiler_3.4.1 assertthat_0.2.0 caTools_1.17.1
[46] igraph_1.0.1 gtable_0.2.0 RcmdrPlugin.epack_1.2.5
[49] glue_1.1.1 readxl_1.0.0 digest_0.6.12
[52] RColorBrewer_1.1-2 knitr_1.16 doParallel_1.0.10
[55] htmltools_0.3.6 KernSmooth_2.23-15 DiceDesign_1.7
[58] data.table_1.10.4 lmtest_0.9-35 foreach_1.4.3
[61] sfsmisc_1.1-1 flashClust_1.01-2 RcmdrPlugin.FactoMineR_1.6-0
[64] fracdiff_1.4-2 backports_1.1.0 lazyeval_0.2.0
[67] magrittr_1.5 AlgDesign_1.1-7.3 checkmate_1.8.3
[70] estimability_1.2 minqa_1.2.4 timeDate_3012.100
[73] Rcpp_0.12.12 coda_0.19-1 bit64_0.9-7
[76] scales_0.4.1 TTR_0.23-2 lsmeans_2.26-3
[79] nloptr_1.0.4 combinat_0.0-8 tibble_1.3.3
[82] latticeExtra_0.6-28 RcmdrPlugin.Export_0.3-1 cellranger_1.1.0
[85] nnet_7.3-12 codetools_0.2-15 curl_2.7
[88] gridExtra_2.2.1 nlme_3.1-131 class_7.3-14
[91] parallel_3.4.1 lhs_0.14 rpart_4.1-11
[94] scatterplot3d_0.3-40
It may happen because you defined yearlier custom lm function by yourself and/or some package with specific lm definition had overriden base::lm.
You can call rm(list = ls()) as well restart your R session to
avoid this kind of behaviour.
Or you can call gt <- base::lm(Sales ~ Discount, data = dtsample2) to call lm from base package with desired functionality.
Please see the example how it happens:
lm <- function(x) {
0
}
lm(x ~ y, data = df)
# Error in lm(x ~ y, data = df) : unused argument (data = df)
Related
In the typical result of the code below, the monthly column should has the monthly aggregations of daily expenses, which has 366 entries, while monthly should be 12 entries. Why did the code below give the total sum of one entry in the Monthly variable?
Although this link https://ro-che.info/articles/2017-02-22-group_by_month_r shows the code leads to the desired outcome, the monthly aggregated 12 values!
So why my code which is exactly the same gives only the total sum, as it is shown in the screenshot of R studio on my laptop!
library(dplyr)
library(lubridate)
set.seed(2017)
#options(digits=4)
(expenses <- data_frame(
date=seq(as.Date("2016-01-01"), as.Date("2016-12-31"), by=1),
amount=rgamma(length(date), shape = 2, scale = 20)))
Monthly<-expenses %>% group_by(month=floor_date(date, "month")) %>%
summarize(amount=sum(amount))
monthly2<-expenses %>% mutate(Mon=month(date), Day=day(date)) %>%
group_by(Mon,Day) %>%
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
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
other attached packages:
[1] lubridate_1.7.4 plyr_1.8.4 XML_3.98-1.20 leaflet_2.0.2
[5] raster_2.9-23 sp_1.3-1 elevatr_0.2.0 clifro_3.2-2
[9] knitr_1.23 MASS_7.3-51.4 forcats_0.4.0 stringr_1.4.0
[13] dplyr_0.8.3 purrr_0.3.2 readr_1.3.1 tidyr_0.8.3
[17] tibble_2.1.3 ggplot2_3.2.0 tidyverse_1.2.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 lattice_0.20-38 utf8_1.1.4
[4] assertthat_0.2.1 zeallot_0.1.0 digest_0.6.20
[7] mime_0.7 R6_2.4.0 cellranger_1.1.0
[10] backports_1.1.4 httr_1.4.0 pillar_1.4.2
[13] rlang_0.4.0 curl_4.0 lazyeval_0.2.2
[16] readxl_1.3.1 rstudioapi_0.10 labeling_0.3
[19] htmlwidgets_1.3 RCurl_1.95-4.12 munsell_0.5.0
[22] shiny_1.3.2 broom_0.5.2 compiler_3.6.1
[25] httpuv_1.5.1 modelr_0.1.4 xfun_0.8
[28] pkgconfig_2.0.2 htmltools_0.3.6 tidyselect_0.2.5
[31] codetools_0.2-16 fansi_0.4.0 crayon_1.3.4
[34] withr_2.1.2 later_0.8.0 bitops_1.0-6
[37] grid_3.6.1 nlme_3.1-140 jsonlite_1.6
[40] xtable_1.8-4 gtable_0.3.0 magrittr_1.5
[43] scales_1.0.0 cli_1.1.0 stringi_1.4.3
[46] reshape2_1.4.3 promises_1.0.1 xml2_1.2.1
[49] generics_0.0.2 vctrs_0.2.0 RColorBrewer_1.1-2
[52] tools_3.6.1 glue_1.3.1 hms_0.5.0
[55] crosstalk_1.0.0 yaml_2.2.0 colorspace_1.4-1
[58] rvest_0.3.4 haven_2.1.1
I am putting some files together using the following code:
data_path <- "daymet"
files <- dir(data_path, pattern = "*.csv")
daymet <- data_frame(filename = files) %>%
mutate(file_contents = map(filename, ~ read_csv(file.path(data_path, .),
skip=7)))%>%
unnest()%>%
mutate(site = str_sub(filename, 1, 3))
At first I had some problems with the error "'GAJPCSR1_2003_2011.csvMapEnv' is not an exported object from 'namespace:maps'". I reinstalled purrr. Error gone, everything worked!
I went to put this back with the rest of my analysis, cleared my environment, and when R got to this chunk, the same error message came back.
I've got all these other packages going, so it seems like one of them is not working well with purrr. Or maybe not. Even if I don't load all the packages, I still get the same error message.
Session Info:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] reprex_0.1.1 mapdata_2.2-6 maps_3.2.0 ggmap_2.6.1 soilDB_1.8.5 aqp_1.10
[7] stringr_1.1.0 modelr_0.1.0 lubridate_1.6.0 dplyr_0.5.0 purrr_0.2.3 readr_1.0.0
[13] tidyr_0.6.1 tibble_1.2 ggplot2_2.2.1 tidyverse_1.1.1
loaded via a namespace (and not attached):
[1] httr_1.2.1 jsonlite_1.5 splines_3.3.2 Formula_1.2-1
[5] assertthat_0.2.0 sp_1.2-5 latticeExtra_0.6-28 backports_1.0.5
[9] lattice_0.20-34 digest_0.6.12 RColorBrewer_1.1-2 checkmate_1.8.2
[13] rvest_0.3.2 colorspace_1.3-2 htmltools_0.3.5 Matrix_1.2-7.1
[17] plyr_1.8.4 psych_1.6.12 devtools_1.12.0 clipr_0.3.3
[21] XML_3.98-1.8 broom_0.4.2 raster_2.5-8 haven_1.0.0
[25] scales_0.4.1 whisker_0.3-2 jpeg_0.1-8 htmlTable_1.9
[29] withr_1.0.2 nnet_7.3-12 lazyeval_0.2.0 mnormt_1.5-5
[33] proto_1.0.0 survival_2.41-3 magrittr_1.5 readxl_0.1.1
[37] evaluate_0.10 memoise_1.0.0 nlme_3.1-131 MASS_7.3-45
[41] forcats_0.2.0 xml2_1.1.1 foreign_0.8-67 tools_3.3.2
[45] data.table_1.10.4 hms_0.3 geosphere_1.5-5 RgoogleMaps_1.4.1
[49] munsell_0.4.3 cluster_2.0.5 plotrix_3.6-4 callr_1.0.0
[53] rlang_0.1.2 grid_3.3.2 rjson_0.2.15 htmlwidgets_0.8
[57] rmarkdown_1.5 labeling_0.3 base64enc_0.1-3 gtable_0.2.0
[61] DBI_0.5-1 reshape_0.8.6 reshape2_1.4.2 R6_2.2.0
[65] gridExtra_2.2.1 knitr_1.17 rprojroot_1.2 Hmisc_4.0-3
[69] stringi_1.1.2 parallel_3.3.2 Rcpp_0.12.10 mapproj_1.2-4
[73] rpart_4.1-10 acepack_1.4.1 png_0.1-7
You can see everything that is masking or being masked with
conflicts(detail = TRUE)
For example, in my current R session you can see below that I've been answering questions on SO because of all the generic data names in the Global Environment, df, dt, and t masking the base functions of the same name. And you can see data table's first and last masking the dplyr versions, because I loaded data.table after dplyr:
> conflicts(detail = T)
$.GlobalEnv
[1] "n" "df" "dt" "gamma" "t"
$`package:stringr`
[1] "%>%"
$`package:data.table`
[1] "between" "first" "last"
$`package:dplyr`
[1] "%>%" "between" "first" "last" "n" "filter" "lag"
[8] "intersect" "setdiff" "setequal" "union"
$`package:ggplot2`
[1] "Position"
$`package:stats`
[1] "df" "dt" "filter" "lag"
$`package:methods`
[1] "body<-" "kronecker"
$`package:base`
[1] "body<-" "gamma" "intersect" "kronecker" "Position" "setdiff" "setequal"
[8] "t" "union"
I get this error in R when trying to load new libraries.
Installation failed: unable to load shared object 'C:/R/R-3.4.0/library/curl/libs/x64/curl.dll':
`maximal number of DLLs reached...
It's nothing to do with curl, it could be any library. My sessionInfo looks like below:
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] parallel stats graphics grDevices utils datasets
[7] methods base
other attached packages:
[1] M3Drop_1.2.0 numDeriv_2016.8-1 bindrcpp_0.2
[4] Seurat_2.0.1 Matrix_1.2-11 cowplot_0.8.0
[7] scater_1.4.0 Biobase_2.36.2 BiocGenerics_0.22.0
[10] tidyr_0.6.3 dplyr_0.7.2 ggplot2_2.2.1
[13] extrafont_0.17
loaded via a namespace (and not attached):
[1] shinydashboard_0.6.1 R.utils_2.5.0
[3] lme4_1.1-13 RSQLite_2.0
[5] AnnotationDbi_1.38.2 htmlwidgets_0.9
[7] grid_3.4.0 trimcluster_0.1-2
[9] ranger_0.8.0 BiocParallel_1.10.1
[11] Rtsne_0.13 devtools_1.13.3
[13] munsell_0.4.3 codetools_0.2-15
[15] ica_1.0-1 captioner_2.2.3
[17] statmod_1.4.30 withr_2.0.0
[19] colorspace_1.3-2 knitr_1.16
[21] stats4_3.4.0 ROCR_1.0-7
[23] robustbase_0.92-7 dtw_1.18-1
[25] Rttf2pt1_1.3.4 NMF_0.20.6
[27] labeling_0.3 lars_1.2
[29] tximport_1.4.0 bbmle_1.0.19
[31] GenomeInfoDbData_0.99.0 mnormt_1.5-5
[33] bit64_0.9-7 rhdf5_2.20.0
[35] diptest_0.75-7 R6_2.2.2
[37] doParallel_1.0.10 GenomeInfoDb_1.12.2
[39] ggbeeswarm_0.6.0 VGAM_1.0-4
[41] locfit_1.5-9.1 flexmix_2.3-14
[43] bitops_1.0-6 DelayedArray_0.2.7
[45] assertthat_0.2.0 SDMTools_1.1-221
[47] scales_0.4.1 nnet_7.3-12
[49] ggjoy_0.3.0 beeswarm_0.2.3
[51] gtable_0.2.0 rlang_0.1.2
[53] MatrixModels_0.4-1 genefilter_1.58.1
[55] scatterplot3d_0.3-40 splines_3.4.0
[57] extrafontdb_1.0 lazyeval_0.2.0
[59] ModelMetrics_1.1.0 acepack_1.4.1
[61] checkmate_1.8.3 reshape2_1.4.2
[63] backports_1.1.0 httpuv_1.3.5
[65] Hmisc_4.0-3 caret_6.0-76
[67] tools_3.4.0 gridBase_0.4-7
[69] gplots_3.0.1 RColorBrewer_1.1-2
[71] proxy_0.4-17 Rcpp_0.12.12
[73] plyr_1.8.4 base64enc_0.1-3
[75] zlibbioc_1.22.0 purrr_0.2.3
[77] RCurl_1.95-4.8 rpart_4.1-11
[79] pbapply_1.3-3 viridis_0.4.0
[81] S4Vectors_0.14.3 SummarizedExperiment_1.6.3
[83] cluster_2.0.6 magrittr_1.5
[85] data.table_1.10.4 SparseM_1.77
[87] mvtnorm_1.0-6 matrixStats_0.52.2
[89] mime_0.5 xtable_1.8-2
[91] pbkrtest_0.4-7 XML_3.98-1.9
[93] mclust_5.3 IRanges_2.10.2
[95] gridExtra_2.2.1 compiler_3.4.0
[97] biomaRt_2.32.1 tibble_1.3.3
[99] KernSmooth_2.23-15 minqa_1.2.4
[101] R.oo_1.21.0 htmltools_0.3.6
[103] segmented_0.5-2.1 mgcv_1.8-18
[105] Formula_1.2-2 geneplotter_1.54.0
[107] tclust_1.2-7 DBI_0.7
[109] diffusionMap_1.1-0 MASS_7.3-47
[111] fpc_2.1-10 car_2.1-5
[113] R.methodsS3_1.7.1 gdata_2.18.0
[115] bindr_0.1 igraph_1.1.2
[117] GenomicRanges_1.28.4 pkgconfig_2.0.1
[119] sn_1.5-0 registry_0.3
[121] foreign_0.8-69 foreach_1.4.3
[123] annotate_1.54.0 vipor_0.4.5
[125] rngtools_1.2.4 pkgmaker_0.22
[127] XVector_0.16.0 stringr_1.2.0
[129] digest_0.6.12 tsne_0.1-3
[131] htmlTable_1.9 edgeR_3.18.1
[133] kernlab_0.9-25 shiny_1.0.4
[135] gtools_3.5.0 quantreg_5.33
[137] modeltools_0.2-21 rjson_0.2.15
[139] nloptr_1.0.4 nlme_3.1-131
[141] viridisLite_0.2.0 limma_3.32.5
[143] lattice_0.20-35 httr_1.3.0
[145] DEoptimR_1.0-8 survival_2.41-3
[147] glue_1.1.1 FNN_1.1
[149] prabclus_2.2-6 iterators_1.0.8
[151] bit_1.1-12 class_7.3-14
[153] stringi_1.1.5 mixtools_1.1.0
[155] blob_1.1.0 DESeq2_1.16.1
[157] latticeExtra_0.6-28 caTools_1.17.1
[159] memoise_1.1.0 irlba_2.2.1
[161] ape_4.1
I am on windows and I tried Sys.setenv(R_MAX_NUM_DLLS=500), from this question, but it doesn't seem to do anything. I have tried to add it to the Rprofile.site file and restarted R but I still get the error. Unloading libraries or not loading so many libraries etc is not a solution. I have seen an option to add R_MAX_NUM_DLLS=500 to .Renviron file, but I am not sure if windows has this.
I was wondering if anyone has any insight.
Try adding the new environment variable, in System Properties.
System environment variable R_MAX_NUM_DLLS is one of several variables that must be set before or very early on in the R startup process. It is too late to set it .Rprofile. However, you can set it in ~/.Renviron, which should then contain a line with:
R_MAX_NUM_DLLS=500
This works on all platforms / operating systems including Windows. The tricky part on Windows is to figure out where the file should be located. The easiest way to figure this out is to call:
> normalizePath("~/.Renviron", mustWork = FALSE)
[1] "/home/alice/.Renviron"
On Windows, you may see something like:
> normalizePath("~/.Renviron", mustWork = FALSE)
[1] "C:\\Users\\alice\\Documents\\.Renviron"
Note how ~/ points to C:\\Users\\alice\\Documents\\ and not to C:\\Users\\alice\\ as one might expect if one comes from a Unix environment.
I am using shape method in dtwclust package. When I run the following code:
data(uciCT)
hc.sbd <- tsclust(CharTraj, type = "hierarchical",
k = 20L, distance = "sbd",
preproc = zscore, centroid = shape_extraction,
seed = 320L)
I have the following error information:
Error in eigen(M) : LAPACK routines cannot be loaded
In addition: Warning message:
In eigen(M) :
unable to load shared object '//PAPER/fchen4/R/R-3.3.2/modules/x64/lapack.dll':
`maximal number of DLLs reached...
After I use library(mgcv), I have got:
Error in eigen(M) : LAPACK routines cannot be loaded
How can I fix this error? I have tried the answers in R lapack routines cannot be loaded. But they do not work for me. I have also updated all the packages. But still cannot work.
The information from sessionInfo() is:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] parallel splines stats graphics grDevices utils datasets methods base
other attached packages:
[1] mgcv_1.8-17 nlme_3.1-131 dtwclust_3.1.2 dtw_1.18-1 clue_0.3-53
[6] ROSE_0.0-3 scatterplot3d_0.3-39 plot3D_1.1 ggrepel_0.6.5 pdfCluster_1.0-2
[11] pastecs_1.3-18 boot_1.3-18 geosphere_1.5-5 sp_1.2-4 XLConnect_0.2-12
[16] XLConnectJars_0.2-12 ica_1.0-1 visNetwork_1.0.3 igraph_1.0.1 Barnard_1.8
[21] Kendall_2.2 pspearman_0.3-0 FSelector_0.21 dunn.test_1.3.4 randomUniformForest_1.1.5
[26] dbscan_1.1-1 Hmisc_4.0-2 Formula_1.2-1 xgboost_0.6-4 doParallel_1.0.10
[31] iterators_1.0.8 foreach_1.4.3 corrplot_0.77 gbm_2.1.3 survival_2.41-3
[36] AppliedPredictiveModeling_1.1-6 e1071_1.6-8 mlbench_2.1-1 caret_6.0-73 lattice_0.20-35
[41] fpc_2.1-10 devtools_1.12.0 lubridate_1.6.0 ggmap_2.6.1 gridExtra_2.2.1
[46] leaflet_1.1.0 qdap_2.2.5 RColorBrewer_1.1-2 qdapTools_1.3.1 qdapRegex_0.6.0
[51] qdapDictionaries_1.0.6 stringr_1.2.0 xtable_1.8-2 tidyr_0.6.1 scales_0.4.1
[56] plotly_4.5.6 ggplot2_2.2.1 psych_1.7.3.21 mxnet_0.9.4 randomForest_4.6-12
[61] cluster_2.0.6 pROC_1.9.1 openxlsx_4.0.17 proxy_0.4-17 dplyr_0.5.0
[66] plyr_1.8.4
loaded via a namespace (and not attached):
[1] backports_1.0.5 lazyeval_0.2.0 entropy_1.2.1 openNLP_0.2-6 crosstalk_1.0.0 digest_0.6.12 htmltools_0.3.5 gender_0.5.1
[9] gdata_2.17.0 magrittr_1.5 checkmate_1.8.2 memoise_1.0.0 xlsx_0.5.7 tm_0.7-1 wordcloud_2.5 jpeg_0.1-8
[17] colorspace_1.3-2 RWeka_0.4-33 RCurl_1.95-4.8 jsonlite_1.4 lme4_1.1-12 registry_0.3 gtable_0.2.0 MatrixModels_0.4-1
[25] car_2.1-4 kernlab_0.9-25 prabclus_2.2-6 DEoptimR_1.0-8 maps_3.1.1 SparseM_1.76 mvtnorm_1.0-6 rngtools_1.2.4
[33] DBI_0.6-1 Rcpp_0.12.10 CORElearn_1.50.3 plotrix_3.6-4 viridisLite_0.2.0 htmlTable_1.9 magic_1.5-6 foreign_0.8-67
[41] mapproj_1.2-4 mclust_5.2.3 stats4_3.3.2 htmlwidgets_0.8 httr_1.2.1 acepack_1.4.1 modeltools_0.2-21 XML_3.98-1.6
[49] rJava_0.9-8 flexmix_2.3-13 openNLPdata_1.5.3-2 nnet_7.3-12 venneuler_1.1-0 reshape2_1.4.2 munsell_0.4.3 tools_3.3.2
[57] geometry_0.3-6 knitr_1.15.1 ModelMetrics_1.1.0 robustbase_0.92-7 caTools_1.17.1 purrr_0.2.2 RgoogleMaps_1.4.1 mime_0.5
[65] quantreg_5.29 slam_0.1-40 compiler_3.3.2 flexclust_1.3-4 pbkrtest_0.4-7 png_0.1-7 tibble_1.3.0 stringi_1.1.5
[73] trimcluster_0.1-2 Matrix_1.2-8 nloptr_1.0.4 RWekajars_3.9.1-3 data.table_1.10.4 bitops_1.0-6 httpuv_1.3.3 R6_2.2.0
[81] latticeExtra_0.6-28 codetools_0.2-15 reports_0.1.4 MASS_7.3-45 gtools_3.5.0 assertthat_0.1 chron_2.3-50 proto_1.0.0
[89] xlsxjars_0.6.1 pkgmaker_0.22 rjson_0.2.15 withr_1.0.2 mnormt_1.5-5 diptest_0.75-7 grid_3.3.2 rpart_4.1-10
[97] class_7.3-14 minqa_1.2.4 misc3d_0.8-4 NLP_0.1-10 shiny_1.0.1 base64enc_0.1-3
After updating to ggplot2 2.0 some of my visualisation code broke and in trying to figure out why, this behaviour concerned me. Running an internal ggplot2 function such as geom_point after the base call of ggplot(), it appears as if geom_point doesn't inherit the data structures from the original ggplot() call.
Example:
test <- data.frame(a = 1:100, b = 801:900)
ggplot(test, aes(x=a, y=b)) + geom_point()
Error: geom_point requires the following missing aesthetics: x, y
Is this explicit defining of aesthetics in each internal ggplot2 call now the default behaviour?
session info:
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.2 (El Capitan)
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] grid stats4 parallel stats graphics grDevices utils datasets
[9] methods base
other attached packages:
[1] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.2.1
[2] biomaRt_2.26.1
[3] GenomicFeatures_1.22.7
[4] AnnotationDbi_1.32.3
[5] biovizBase_1.18.0
[6] ggbio_1.18.1
[7] cowplot_0.6.0
[8] gridExtra_2.0.0
[9] doParallel_1.0.10
[10] IlluminaHumanMethylation450kmanifest_0.4.0
[11] scales_0.3.0
[12] reshape2_1.4.1
[13] ggplot2_2.0.0
[14] limma_3.26.4
[15] lumi_2.22.0
[16] minfi_1.16.0
[17] bumphunter_1.10.0
[18] locfit_1.5-9.1
[19] iterators_1.0.8
[20] foreach_1.4.3
[21] Biostrings_2.38.3
[22] XVector_0.10.0
[23] SummarizedExperiment_1.0.2
[24] GenomicRanges_1.22.3
[25] GenomeInfoDb_1.6.1
[26] IRanges_2.4.6
[27] S4Vectors_0.8.7
[28] lattice_0.20-33
[29] Biobase_2.30.0
[30] BiocGenerics_0.16.1
loaded via a namespace (and not attached):
[1] nlme_3.1-122 bitops_1.0-6 matrixStats_0.50.1
[4] RColorBrewer_1.1-2 tools_3.2.3 doRNG_1.6
[7] nor1mix_1.2-1 affyio_1.40.0 rpart_4.1-10
[10] KernSmooth_2.23-15 Hmisc_3.17-1 DBI_0.3.1
[13] mgcv_1.8-10 colorspace_1.2-6 nnet_7.3-11
[16] methylumi_2.16.0 GGally_1.0.0 base64_1.1
[19] preprocessCore_1.32.0 graph_1.48.0 pkgmaker_0.22
[22] labeling_0.3 rtracklayer_1.30.1 genefilter_1.52.0
[25] quadprog_1.5-5 affy_1.48.0 RBGL_1.46.0
[28] stringr_1.0.0 digest_0.6.8 Rsamtools_1.22.0
[31] foreign_0.8-66 illuminaio_0.12.0 siggenes_1.44.0
[34] GEOquery_2.36.0 dichromat_2.0-0 BSgenome_1.38.0
[37] RSQLite_1.0.0 BiocInstaller_1.20.1 mclust_5.1
[40] BiocParallel_1.4.3 acepack_1.3-3.3 VariantAnnotation_1.16.4
[43] RCurl_1.95-4.7 magrittr_1.5 Formula_1.2-1
[46] futile.logger_1.4.1 Matrix_1.2-3 Rcpp_0.12.2
[49] munsell_0.4.2 stringi_1.0-1 nleqslv_2.9.1
[52] MASS_7.3-45 zlibbioc_1.16.0 plyr_1.8.3
[55] splines_3.2.3 multtest_2.26.0 annotate_1.48.0
[58] beanplot_1.2 igraph_1.0.1 rngtools_1.2.4
[61] corpcor_1.6.8 codetools_0.2-14 mixOmics_5.2.0
[64] futile.options_1.0.0 XML_3.98-1.3 latticeExtra_0.6-26
[67] lambda.r_1.1.7 gtable_0.1.2 reshape_0.8.5
[70] xtable_1.8-0 survival_2.38-3 OrganismDbi_1.12.1
[73] GenomicAlignments_1.6.3 registry_0.3 ellipse_0.3-8
[76] cluster_2.0.3 rgl_0.95.1441