Error Checking Package that Depends on ggplot2 - r

I have a few packages that depend on ggplot2 and have run into issues when I run R CMD check coefplot_1.1.7.tar.gz.
I get the error below.
* checking whether the package can be loaded ... ERROR
Loading required package: ggplot2
Error: package 'ggplot2' could not be loaded
In addition: Warning message:
In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
there is no package called 'ggplot2'
Execution halted
It looks like this package has a loading problem: see the messages for
details.
This message occurs for all of my packages that depend on ggplot2, not just this one.
It builds, installs and works just fine, but for some reason the check fails.
I had some funky stuff going on with my .libPaths argument in the Rprofile.site file in R 2.14.2 so I did a fresh install of R 2.15.0 and still have this problem.
Is this a known issue with ggplot or have I unwittingly started doing something wrong?
EDIT In my Rgui (through RStudio) .libPaths() returns
[1] "C:/Users/Jared/Documents/R/win-library/2.15"
[2] "C:/Program Files/R/R-2.15.0/library"
[3] "C:/Program Files/RStudio/R/library"
While getting to the R termnial from the cmd prompt returns
[1] "C:/Users/Jared/Documents/R/win-library/2.15"
[2] "C:/Program Files/R/R-2.15.0/library"
And getting to the R termnial through GitBash (MINGW32) returns
[1] "C:/Program Files/R/R-2.15.0/library"
I'm sure that is causing some of the problem? Maybe I need to fix this through Rprofile.site: .libPaths("~/R/win-library/2.15")?

Related

Sys.which('make') returns an empty vector, resulting in installation failure of package built with .cpp

I've already updated r, rtools and rstudio. But it seems unable to find make.exe, while in C:\rtools40\usr\bin\make.exe it exists.
> find_rtools()
[1] TRUE
> Sys.which('make')
make
""
> R.Version()$version.string
[1] "R version 4.0.3 (2020-10-10)"
Rtools is rtools40-x86_64.exe downloaded from https://cran.r-project.org/bin/windows/Rtools/.
All packages are up to date (Rstudio told me so).
And when I'm trying to install a package built with Rcpp, it returns
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'testpkg'
and the installation fails. Is there any way I can deal with it?

library problems in R

I installed the package required and set my library using install.packages("bipartite",lib="C:/Users/Owner/Documents/Rwork")
When i finish installing package, it says the downloaded binary packages are in C:\Users\Owner\AppData\Local\Temp\RtmpuGqI8Q\downloaded_packages
I checked my directory using dir(), all the things in package bipartite are in C:/Users/Owner/Documents/Rwork
When i try to load the package using this command, library("bipartite", lib.loc="C:/Users/Owner/Documents/Rwork") the error appear
Error: package ‘vegan’ required by ‘bipartite’ could not be found
In addition: Warning message:
package ‘bipartite’ was built under R version 3.3.3
Checked my dir() again and it stated that there is a "vegan' in my working directory
Tried to look at .libPaths() it show this
[1] "C:/Users/Owner/Documents/R/win-library/3.3"
[2] "C:/Program Files/R/R-3.3.2/library"
How do i solve this? Do i need to change the library path?
I could reproduce your error. It looks like R does not install the dependencies. This works however:
library(permute, lib.loc = "C:/Users/Owner/Documents/Rwork")
library(vegan, lib.loc = "C:/Users/Owner/Documents/Rwork")
library(statnet.common, lib.loc = "C:/Users/Owner/Documents/Rwork")
library(network, lib.loc = "C:/Users/Owner/Documents/Rwork")
library(sna, lib.loc = "C:/Users/Owner/Documents/Rwork")
library(bipartite, lib.loc = "C:/Users/Owner/Documents/Rwork")
It's just a workaround. Maybe this can also help:
library(devtools)
load_all("C:/Users/Owner/Documents/Rwork")

Error in R packages Installation using Require

Please give me solution..
if (!require('SnowballC',character.only=TRUE))
install.packages('https://cran.r-project.org/bin/windows/contrib/3.4/SnowballC_0.5.1.zip', repos=NULL, dep=TRUE);
library('SnowballC')
when i use this command..I am getting message like
Warning message: In library(package, lib.loc = lib.loc, character.only
= TRUE, logical.return = T RUE, : there is no package called 'SnowballC' Warning message: package 'SnowballC' was built under R
version 3.3.1
Binary package compiled with different version of R
Warning message:
package ‘SnowballC’ was built under R version 3.3.1
By default, R will install pre-compiled versions of packages if they are found. If the version of R under which the package was compiled does not match your installed version of R you will get the message above.
The solution is to download the package source and install by hand with e.g.:
#File name might be different
R CMD INSTALL SnowballC_0.5.1.tar.gz
Source: http://mazamascience.com/WorkingWithData/?p=1185

Error on R studio startup

I get the following error message in the console when opening Rstudio :
Error installing package: Error: ERROR: no packages specified
The filename, directory name, or volume label syntax is incorrect.
My R version is 3.1.1
This is the error you get from calling install.packages with no package specified.
> install.packages()
Error in install.packages() : no packages were specified
You might want to check whether something like that is included in your Rprofile.site file.

R within Rstudio cannot find rmarkdown package

I am trying to use rmarkdown, within Rstudio (0.98.953) on a PC, for the first time. I have upgraded to the latest versions of R (3.1.1) and R studio. The output from sessionInfo() is provided at the end of this question.
As I understand it rmarkdown should be included within Rstudio. However, when I select to create a markdown document in Rstudio, a dialog box pops up saying additional packages need to be installed. The installation of rmarkdown always then fails, with the following message:
Installing package into '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win-library/3.1'
(as 'lib' is unspecified)
* installing *source* package 'rmarkdown' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'rmarkdown'
Error: loading failed
Execution halted
*** arch - x64
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'rmarkdown'
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
* removing '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win- library/3.1/rmarkdown'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "\\cfsk18.campus.gla.ac.uk\SSD_Home_Data_X\jm383x\My Documents\R\win-library\3.1" "C:/PROGRA~1/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz"' had status 1
2: In utils::install.packages("C:/Program Files/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz", :
installation of package 'C:/PROGRA~1/RStudio/R/packages/rmarkdown_0.2.49_047a80058bb4ef0b142196013d1c4dd8870d4dd9.tar.gz' had non-zero exit status
I assume this is something to do with using a managed desktop in my place of work. However this is not usually a problem as far fewer restrictions are placed on these machines than is usually the case, and all other packages, software etc tend to work.
I have also tried installing rmarkdown directly from github. Again the installer cannot identify the package rmarkdown itself.
What is likely to be the cause of the error?
SessionInfo output:
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.1.1
Attempt to install directly from github repo:
devtools::install_github("rstudio/rmarkdown")
Installing github repo rmarkdown/master from rstudio
Downloading master.zip from https://github.com/rstudio/rmarkdown/archive/master.zip
Installing package from C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv/master.zip
Installing rmarkdown
Installing dependencies for rmarkdown:
httpuv
Installing package into ‘\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/httpuv_1.3.0.zip'
Content type 'application/zip' length 857357 bytes (837 Kb)
opened URL
downloaded 837 Kb
package ‘httpuv’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv\downloaded_packages
"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" --vanilla CMD INSTALL \
"C:\Users\jm383x\AppData\Local\Temp\RtmpINmLRv\devtoolscec10833677\rmarkdown-master" \
--library="\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win- library/3.1" --install-tests
* installing *source* package 'rmarkdown' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'rmarkdown'
Error: loading failed
Execution halted
*** arch - x64
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'rmarkdown'
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
* removing '\\cfsk18.campus.gla.ac.uk/SSD_Home_Data_X/jm383x/My Documents/R/win- library/3.1/rmarkdown'
Try running this code to get the latest version of the rmarkdown package, which should solve the issue:
install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com")
The issue is that the RStudio IDE looks at a static CRAN snapshot that was taken before the rmarkdown package was updated. For more information, see this link: https://groups.google.com/forum/#!topic/rropen/Kgg8z6FF40I
I wonder if the problem is the space in the path shown for the --library option to your install_github command. I know you say you've installed packages OK before, but my setup sounds just slike yours and rmarkdown works for me. I have RStudio 0.98.953 on Win7, which is a very locked-down corporate machine. I've coerced it into letting me install R packages by setting the env variable R_LIBS to my network home drive. Loading packages is slow, but I have no choice because I cannot write to the C: drive. So, my install_github command has --library="H:/Rlib". Your path has "My Documents" embedded in it. I'm not positive that's the problem, but my github installation of "rstudio/rmarkdown" did succeed. When I do File -> New File -> R Markdown, followed by a press of the "Knit HTML" button, that also completes successfully.
The RStudio github page https://github.com/rstudio/rmarkdown#installation makes it sound like manual installation of rmarkdown in RStudio isn't required, but I did it anyway because I don't always use R through RStudio. Sorry, but I didn't test RStudio by making a new R Markdown file before I manually installed the package.
The RStudio blog post http://blog.rstudio.org/2014/06/18/r-markdown-v2/ says clearly that the rmarkdown package is intended to replace the previous markdown package. The rmarkdown package does not yet appear to be on CRAN, so install_github is necessary.
The best that worked for me is to quit Rstuido, then install rmarkdown package in the base R (not any IDE) and restarting Rstudio.
I am on Windows 10, R 3.3.1, Rstudio Version 0.99.903

Resources