I am trying to run the example from the geom_subplot help page from the ggsubplot package.
library(ggplot2)
devtools::install_github('ggsubplot', 'garrettgman')
library(ggsubplot)
ggplot(nasa) +
geom_subplot(aes(long, lat, group = id,
subplot = geom_point(aes(surftemp, temperature), size = 1/4))) +
coord_map()
And I get the following error:
Error in layout_base(data, vars, drop = drop) :
At least one layer must contain all variables used for facetting
This same error occurs with with every ggsubplot example I've tried to run so far. I've tried with both the CRAN and github version of ggsubplot. I would bet this is an incompatibility with the newest version of ggplot2 but I don't know enough about ggplot development to diagnose it myself.
R.version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 1.0
year 2014
month 04
day 10
svn rev 65387
language R
version.string R version 3.1.0 (2014-04-10)
nickname Spring Dance
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggsubplot_0.3.1 ggplot2_0.9.3.1 devtools_1.5
loaded via a namespace (and not attached):
[1] colorspace_1.2-4 digest_0.6.4 evaluate_0.5.5 grid_3.1.0 gtable_0.1.2 httr_0.3 labeling_0.2 MASS_7.3-32
[9] memoise_0.2.1 munsell_0.4.2 parallel_3.1.0 plyr_1.8.1 proto_0.3-10 Rcpp_0.11.1 RCurl_1.95-4.1 reshape2_1.4
[17] scales_0.2.4 stringr_0.6.2 tools_3.1.0 whisker_0.3-2
It seems that package ggsubplot no longer is maintained.
Message on CRAN (as of 2016-12-23):
Package ‘ggsubplot’ was removed from the CRAN repository.
Formerly available versions can be obtained from the archive.
Archived on 2016-01-11 as requested by the maintainer garrett#rstudio.com.
On GitHub (https://github.com/garrettgman/ggsubplot), the last commit dates back to 2015-07-09.
Installation from GitHub under R 3.3.2 with devtools::install_github('garrettgman/ggsubplot') failed with an error message complaining about missing function eval.
Related
I want to update an R package using Microsoft R Open via Microsoft R Server. I can see in MRAN package repo that the package version is 1.2.0 but when I try an update in RStudio it says all packages up to date although respective package is still on version 1.1.0 (dbplyr in my case). Why is R not updating the package? RStudio points to C:\Program Files\Microsoft\ML Server\R_SERVER.
sessionInfo()
#>R version 3.4.1 (2017-06-30)
#>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 States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
#>[4] LC_NUMERIC=C LC_TIME=English_United States.1252
#>attached base packages:
#>[1] stats graphics grDevices utils datasets methods base
#>other attached packages:
#>[1] RevoUtilsMath_10.0.0 RevoUtils_10.0.5 RevoMods_11.0.0 MicrosoftML_1.5.0 mrsdeploy_1.1.2 RevoScaleR_9.2.1
#>[7] lattice_0.20-35 rpart_4.1-11
#>loaded via a namespace (and not attached):
#>[1] codetools_0.2-15 CompatibilityAPI_1.1.0 foreach_1.4.4 grid_3.4.1 R6_2.2.0
#>[6] jsonlite_1.4 curl_2.6 iterators_1.0.8 tools_3.4.1 yaml_2.1.14
#>[11] compiler_3.4.1 mrupdate_1.0.1
packageVersion("dbplyr")
#>‘1.1.0’
RStudio IDE has as mirror Global (CDN) - RStudio but I guess this is overruled by MRAN?
So you are running Microsoft R Server, and that has an R version of 3.4.1. I believe what happens is that when you try to upgrade using MRAN, the upgrade takes into consideration which version of R you're on - and (I believe again) the latest version of dbplyr for R 3.4.1 was 1.1.0. You can read more about snapshots and checkpoints here.
What you can do if you want is to install the package straight from the CRAN repo, using code something like so:
install.packages("dbplyr", repos = "https://cloud.r-project.org/", dependencies=TRUE, lib = pkg.dir)
Hope this helps!
Niels
According to the shortcuts help (Alt+Shift+K) the combination Ctrl+Shift+D should run the documentation routines. (This is also said in Section 5.1 of Hadley Wickhams "R packages" http://runsheng.github.io/attachment/r-packages.pdf.) But in my RStudio-setting, it doublicates the selected row (so I don't belive it is a global usage problem brought up in the answers here: Visual Studio won't recognize key combination). On https://support.rstudio.com/hc/en-us/community/posts/201819358-Ctrl-Shift-D-doesn-t-run-document-in-preview-release the issue was brought up by someone, but without a solution. How can I make RStudio do what it should do?
I'm using RStudio version 0.99.902 and sessionInfo() gives:
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] hmi_0.1.0 roxygen2_5.0.1 coda_0.18-1 MASS_7.3-45 devtools_1.12.0
loaded via a namespace (and not attached):
[1] magrittr_1.5 tools_3.3.1 withr_1.0.2 rstudioapi_0.6 Rcpp_0.12.5
[6] memoise_1.0.0 stringi_1.1.1 grid_3.3.1 stringr_1.0.0 digest_0.6.9
[11] lattice_0.20-33
Can you double check what these options are set to in Project Options?
You might need to ensure that both
Use devtools package functions in available
Generate documentation with Roxygen
are both checked.
So I installed an old version of ggplot2 with install_version from devtools (0.9.1 or something) to see how it worked - over the previously installed 2.0.0 version by the way. I then upgraded the version and it surprisingly gave me version 1.0.0, not the current 2.0.0.
Now when I do an install.packages("ggplot2") I get the same 1.0.0. Also selecting "Check for package upgrades.." item from the Rstudio menu it tells me "All packages up to date".
What gives? Isn't the newest version of ggplot now 2.0.0? Here is my session info:
R version 3.2.2 (2015-08-14)
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] devtools_1.9.1 ggplot2_1.0.0 dplyr_0.4.3 shiny_0.12.2 RevoUtils_7.5.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 magrittr_1.5 MASS_7.3-43 munsell_0.4.2 colorspace_1.2-6
[6] xtable_1.8-0 R6_2.1.1 stringr_1.0.0 plyr_1.8.3 tools_3.2.2
[11] parallel_3.2.2 grid_3.2.2 gtable_0.1.2 DBI_0.3.1 htmltools_0.2.6
[16] assertthat_0.1 digest_0.6.8 reshape2_1.4.1 memoise_0.2.1 mime_0.4
[21] stringi_1.0-1 scales_0.3.0 jsonlite_0.9.19 httpuv_1.3.3 proto_0.3-10
>
Here are the repositories it is seeing:
> AP <- available.packages()
> apdf <- data.frame(AP)
> unique(apdf$Repository)
[1] http://mran.revolutionanalytics.com/snapshot/2014-12-01/src/contrib
[2] http://www.stats.ox.ac.uk/pub/RWin/src/contrib
2 Levels: http://mran.revolutionanalytics.com/snapshot/2014-12-01/src/contrib ...
>
Update:
Thanks to Dirk, I see what happened. Looks like installing RRO package reset my CRAN repository. I can also sort of see why that had to be, although maybe I should have got a warning about it. From this blog entry I see how to fix it too. http://www.r-bloggers.com/permanently-setting-the-cran-repository/
Run
AP <- available.packages() # possibly with repo options
and examine the result set.
That is what your R session knows about packages, and it is a function of
the R version; you generally want the newest series (and you have 3.2.*)
the repos you select (which you did not show)
Edit: I typically use options("repos") to check which repositories I have, and I tend to control that from Rprofile.site. But you seem to have RevoR and I do not know how/if that interacts.
I followed the instruction on the Github. It returned me an error like this:
install_github("shinyTable", "trestletech")
Downloading github repo trestletech/shinyTable#master
Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached
In addition: Warning message:
Username parameter is deprecated. Please use trestletech/shinyTable
Then, I tried to download the repo zip file and installed the shinyTable from local zip file in R studio. After that, I library(shinyTable). It return me an error.
> install.packages("D:/UserData/xxxx/Downloads/shinyTable-master.zip", repos = NULL)
Installing package into ‘D:/UserData/xxxx/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
> library(shinyTable)
Error in library(shinyTable) : there is no package called ‘shinyTable’
This is sessionInfo() result:
R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
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] shinyRGL_0.1.0 devtools_1.8.0 rJava_0.9-7
loaded via a namespace (and not attached):
[1] rgl_0.95.1247 Rcpp_0.12.0 digest_0.6.8 mime_0.3 R6_2.1.0 xtable_1.7-4 git2r_0.10.1
[8] magrittr_1.5 httr_1.0.0 stringi_0.5-5 curl_0.9.2 xml2_0.1.1 tools_3.2.1 stringr_1.0.0
[15] shiny_0.12.2 httpuv_1.3.3 rversions_1.0.2 htmltools_0.2.6 tcltk_3.2.1 memoise_0.2.1
Does anyone know the reason and tell me how to install it? Thank you.
I had similar issues recently. Can you try this:
library(devtools)
install_git("https://github.com/trestletech/shinyTable")
I tried installing all the dependant packages and also tried another repo source as recommended in another post here.
R version 3.2.0 x64
install.packages("fracdiff")
install.packages("Rcpp")
install.packages("RcppArmadillo")
install.packages("colorspace")
install.packages("forecast", dep=T)
install.packages("forecast", repos=c("http://cran.rstudio.com"),dep=T)
library("forecast")
then I get
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
Loading required package: timeDate
Error : .onAttach failed in attachNamespace() for 'forecast', details:
call: fun(libname, pkgname)
error: 4 arguments passed to .Internal(nchar) which requires 3
In addition: Warning message:
package ‘forecast’ was built under R version 3.2.1
Error: package or namespace load failed for ‘forecast’
sessionInfo()
R version 3.2.0 (2015-04-16)
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 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] Hmisc_3.16-0 ggplot2_1.0.1 Formula_1.2-1 survival_2.38-1 lattice_0.20-31 zoo_1.7-12 timeSeries_3012.99 timeDate_3012.100
loaded via a namespace (and not attached):
[1] Rcpp_0.11.6 cluster_2.0.1 magrittr_1.5 MASS_7.3-41 splines_3.2.0 forecast_6.1 munsell_0.4.2
[8] colorspace_1.2-6 quadprog_1.5-5 stringr_1.0.0 plyr_1.8.3 tools_3.2.0 nnet_7.3-9 parallel_3.2.0
[15] gtable_0.1.2 latticeExtra_0.6-26 tseries_0.10-34 digest_0.6.8 gridExtra_0.9.1 RColorBrewer_1.1-2 reshape2_1.4.1
[22] acepack_1.3-3.3 rpart_4.1-9 fracdiff_1.4-2 stringi_0.4-1 scales_0.2.5 foreign_0.8-63 proto_0.3-10
I tried to reproduce. I get no message about either loading timeDate or the error you see. I do get a message about loading pkg:zoo. The package loads and announces its version number. Try updating to R version 3.2.1, since that is where a new argument to nchar was introduced:
new$Text[ grep("nchar", news$Text) ]
• nchar(x, *) and nzchar(x) gain a new argument keepNA which governs how the result for NAs in x is determined. For the R 3.2.x series, the default remains FALSE which is fully back compatible. From R 3.3.0, the default will change to keepNA = NA and you are advised to consider this for code portability.