R installed the recharts error [duplicate] - r

This question already has answers here:
lib unspecified & Error in loadNamespace
(5 answers)
Error: Package "ggplot2" could not be found, when loading the caret package
(4 answers)
Closed 5 years ago.
> install_github("madlogos/recharts")
Downloading GitHub repo madlogos/recharts#master
from URL https://api.github.com/repos/madlogos/recharts/zipball/master
Installing recharts
"D:/PROGRA~1/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD \
INSTALL \
"C:/Users/Administrator/AppData/Local/Temp/RtmpAlSrMx/devtools26ec72ed478f/madlogos-recharts-ef72a0a" \
--library="D:/Program Files/R/R-3.3.3/library" --install-tests
* installing *source* package 'recharts' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called 'ggthemes'
ERROR: lazy loading failed for package 'recharts'
* removing 'D:/Program Files/R/R-3.3.3/library/recharts'
* restoring previous 'D:/Program Files/R/R-3.3.3/library/recharts'
Error: Command failed (1)
How to solve the problem? I install the recharts but it doesn't have echartr function and only have echart function.
How to solve it?

The installation depends on ggthemes, as the error message says. Install that package, plus any others that appear in similar error messages.

Related

Problems Installing choroplethrZip: "Command failed (1)"

So I have been hitting my head against the wall for a few days now trying to understand why my machine will not load choroplethrZip. I have tried the recommended installation pathway (with devtools and github) but I keep receiving the error message below:
#install.packages("devtools")
library(devtools)
install_github('arilamstein/choroplethrZip#v1.5.0')
Downloading GitHub repo arilamstein/choroplethrZip#v1.5.0
from URL https://api.github.com/repos/arilamstein/choroplethrZip/zipball/v1.5.0
Installing choroplethrZip
"C:/PROGRA~1/R/R-35~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/dbrennan/AppData/Local/Temp/Rtmp0q4jjY/devtools29fc168c68f5/arilamstein-choroplethrZip-3cbc9f3" \
--library="C:/Users/dbrennan/Documents/R/win-library/3.5" --install-tests
* installing *source* package 'choroplethrZip' ...
** R
** data
** inst
** tests
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'choroplethr' 2.2.0 is being loaded, but >= 3.3.0 is required
ERROR: lazy loading failed for package 'choroplethrZip'
* removing 'C:/Users/dbrennan/Documents/R/win-library/3.5/choroplethrZip'
In R CMD INSTALL
Installation failed: Command failed (1)
I have tried restarting r and running the code immediately, as well as restarting the computer itself. I have also tried to read the package zip file into R directly but that has not worked either. Any help would be greatly appreciated.
Buried within the error message is this:
namespace 'choroplethr' 2.2.0 is being loaded, but >= 3.3.0 is required
And in fact, if you look at the DESCRIPTION page of choroplethrZip you will see that it imports "choroplethr (>= 3.3.0)".
Since you only have version 2.2.0 installed, I recommend typing:
update.packages()
which will update all your packages. Then try installing and loading choroplethrZip again.

devtools::install_git fails to install dependencies of packages in Depends or Imports

I have a package that depends on the package extrafont. If extrafont and its dependency Rttf2pt1 aren't present on the user's system, installation of my package fails. I have extrafont as "Depends" in my package's DESCRIPTION file. When I run devtools::install_git() to install my package from a URL, the output terminates with:
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'Rttf2pt1'
Error : package 'extrafont' could not be loaded
ERROR: lazy loading failed for package 'tntpr'
* removing 'C:/Users/SFirke/Documents/R/win-library/3.3/tntpr'
Looks like extrafont installs okay, but doesn't work because Rttf2pt1 is missing. When I add Rttf2pt1 to the Depends list in my DESCRIPTION file, then the installation succeeds, installing both extrafont and Rttf2pt1 and my package.
Why do I need to put Rttf2pt1 in my Depends list? It's present on the "Imports" list in the DESCRIPTION file from the extrafont package:
Depends:
R (>= 2.15)
Imports:
extrafontdb,
grDevices,
utils,
Rttf2pt1
Additional info
When I run devtools::install_git("https://myurl.com/tntpr.git", dependencies = TRUE), I get the following output. It installs dplyr from GitHub, then extrafonts, then fails loading my package:
Installing tntpr
Downloading GitHub repo hadley/dplyr#master
from URL https://api.github.com/repos/hadley/dplyr/zipball/master
Installing dplyr
"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/SFirke/AppData/Local/Temp/RtmpMlRSSR/devtools3dfc4e39620/hadley-dplyr-5902277" --library="C:/Users/SFirke/Documents/R/win-library/3.3" --install-tests
* installing *source* package 'dplyr' ...
** libs
*** arch - i386
C:/RBuildTools/3.4/mingw_32/bin/g++ -I"C:/PROGRA~1/R/R-33~1.2/include" -DNDEBUG -I../inst/include -DCOMPILING_DPLYR -I"C:/Users/SFirke/Documents/R/win-library/3.3/Rcpp/include" -I"C:/Users/SFirke/Documents/R/win-library/3.3/BH/include" -I"C:/Users/SFirke/Documents/R/win-library/3.3/bindrcpp/include" -I"C:/Users/SFirke/Documents/R/win-library/3.3/plogr/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o
<--- lots more lines like this ^^^^^ --->
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (dplyr)
Installing 1 package: extrafont
Installing package into ‘C:/Users/SFirke/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/extrafont_0.17.zip'
Content type 'application/zip' length 34323 bytes (33 KB)
downloaded 33 KB
package ‘extrafont’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\SFirke\AppData\Local\Temp\RtmpMlRSSR\downloaded_packages
"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:/Users/SFirke/AppData/Local/Temp/RtmpMlRSSR/file3dfc4a973a21" \
--library="C:/Users/SFirke/Documents/R/win-library/3.3" --install-tests
* installing *source* package 'tntpr' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'Rttf2pt1'
Error : package 'extrafont' could not be loaded
ERROR: lazy loading failed for package 'tntpr'
* removing 'C:/Users/SFirke/Documents/R/win-library/3.3/tntpr'
Error: Command failed (1)
The problem: There are issues specific to Windows where both devtools 1.12.0 (the current CRAN version) and the current development version of devtools 1.12.0.9000 have trouble with nested / recursive dependencies (i.e., say your package A depends on package B which depends on package C; devtools functions install_*(A) will not install C).
See this comment re: the development version and the top parts of the thread that note problems with the CRAN version as well and this package's workaround of manually specifying sub-dependencies to install.
Solution: I installed an old version of devtools 1.11.1 (released April 2016), which works for my install_git() call above even when there are dependencies missing that need to be installed.
install.packages("devtools") # from CRAN
devtools::install_version("devtools", version = "1.11.1", repos = "http://cran.us.r-project.org") # get the old version
Then restart R and use devtools as intended.

R cran Impossible to install dependencies recursively from install_github from devtools

I try to test my package developed on Ubuntu 16.04 with Windows 7. For both platforms I work on R 3.3.1 (but I also test on 3.3.0).
My package is saved on my GitHub repo (https://github.com/charlottesirot/elementR). When I run this command from Ubuntu, no problem happens:
library(devtools)
install_github("charlottesirot/elementR", dependencies = T , force = T)
but with windows 7, I have the following answer:
Downloading GitHub repo charlottesirot/elementR#master from URL
https://api.github.com/repos/charlottesirot/elementR/zipball/master
Installing elementR "C:/PROGRA~1/R/R-33~1.1/bin/i386/R" --no-site-file
--no-environ --no-save --no-restore --quiet CMD \ INSTALL \ "C:/Users/Cha/AppData/Local/Temp/RtmpUX1GVA/devtoolsa907a336b/charlottesirot-elementR-103e064"
\ --library="C:/Users/Cha/Documents/R/win-library/3.3"
--install-tests
installing source package 'elementR' ...
** R
** inst
** preparing package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no
package called 'XML' ERROR: lazy loading failed for package 'elementR'
removing 'C:/Users/Cha/Documents/R/win-library/3.3/elementR' Error: Command failed (1)
As I understand, R tries to install the dependencies of my package (e.g. Shiny...) but it does not manage to install the dependencies of the dependencies (e.g. XML from gnumeric package)
Thus I try to manually install XML thinking that perhaps there was a problem with XML and then:
installing source package 'elementR' ...
** R
** inst
** preparing package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there
is no package called 'gtools' ERROR: lazy loading failed for package
'elementR'
removing 'C:/Users/Cha/Documents/R/win-library/3.3/elementR'
I cannot install all the packages manually, it does not make sense !!!
Moreover when I try something less cryptic than my package, thinking that I could makea mistake in my code:
install_github("hadley/ggplot2", force = T)
installing source package 'ggplot2' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called 'assertthat' ERROR: lazy loading failed for package 'ggplot2'
removing 'C:/Users/Cha/Documents/R/win-library/3.3/ggplot2'
restoring previous 'C:/Users/Cha/Documents/R/win-library/3.3/ggplot2' Error: Command failed (1
)
I think there is a problem from the install_github ???
What do you think ??
Here is my Namespace:
exportPattern("^[[:alpha:]]+")
importFrom(R6, R6Class)
importFrom(shinyjs, colourInput)
importFrom(shinyjs, delay)
importFrom(shinyjs, useShinyjs)
importFrom(gnumeric, read.gnumeric.sheet)
importFrom(abind, abind)
importFrom(tcltk2, tk2text)
importFrom(gdata, read.xls)
importFrom("readODS", read.ods)
importFrom("grDevices", "bmp", "colorRampPalette", "dev.off", "jpeg",
"png", "rainbow", "tiff")
importFrom("graphics", "abline", "layout", "legend", "mtext", "par",
"plot", "points", "rect", "text", "title")
importFrom("stats", "sd")
importFrom("utils", "read.table", "write.csv", "write.table")
import(shinydashboard, shiny, stringr, lmtest, reader, devtools, tcltk)
For me, it looks ok but what do you think ?
I looked at a lot of article on internet but I only found one message which is exactly the same than my case but it is not enough informative :
Cannot install "flexdashboard package"
I am totally stuck at this point and I would like to have your help regarding this issue.
Thank you verrrrrry much in advance !!
CHa
Recently, I encountered a similar or maybe related issue. As it turned out, there was a bug in devtools install_github, missing the correct installation of dependencies, despite dependecies=TRUE. Have a look at: Does install_github recursively install dependencies? If the problem persists, better contact the authors directly via their github repository.
Plus, I just observed another issue arising after a Windows update, during which permissions seemed to have been altered to download or update packages into personal Win User libraries instead of the "default" R library folder. I suspect devtools seemed consequently lost as to which packages were loaded or available at which versioning. A fresh R reinstallation (i.e., library folder cleansing) solved that issue, but such may not always be convenient.

Cannot install "flexdashboard package"

I tried installing the flexdashboard package but an error message came up:
Here is the code:
devtools::install_github("rstudio/flexdashboard")
Error Message:
Downloading GitHub repo rstudio/flexdashboard#master
Installing flexdashboard
Installing 1 packages: digest
package ‘digest’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘digest’
"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore \
CMD INSTALL \
"C:/Users/Nicholas/AppData/Local/Temp/RtmpekRfW3/devtools3e9457ae3791/rstudio-flexdashboard-e68ac39" \
--library="C:/Users/Nicholas/Documents/R/win-library/3.2" --install-tests
* installing *source* package 'flexdashboard' ...
** R
** inst
** tests
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called 'digest'
ERROR: lazy loading failed for package 'flexdashboard'
* removing 'C:/Users/Nicholas/Documents/R/win-library/3.2/flexdashboard'
Error: Command failed (1)
It seems to be crashing because it tries to update the digest package upon which it depends, and fails to remove it because it's in use.
Close R and then navigate to C:/Users/Nicholas/Documents/R/win-library/3.2 and delete the digest folder. Then, launch R and try the install again.

Github Quandl not able to install

When I tried installing quandl it is showing this error message. Can anyone help ??
> install_github("quandl/R-package")
Downloading GitHub repo quandl/R-package#master
Installing Quandl
Installing 1 packages: stringi
package ‘stringi’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘stringi’
"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore CMD INSTALL \
"C:/Users/saikitti/AppData/Local/Temp/RtmpqoWawf/devtools25b4184b2cd/quandl-quandl-r-9182d61" \
--library="C:/Users/saikitti/Documents/R/win-library/3.2" --install-tests
* installing *source* package 'Quandl' ...
** R
** tests
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called 'stringi'
ERROR: lazy loading failed for package 'Quandl'
* removing 'C:/Users/saikitti/Documents/R/win-library/3.2/Quandl'
Error: Command failed (1)
You missed a Depends::
there is no package called 'stringi'
But Quandl is on CRAN, so why don't you do install.packages("Quandl") ?

Resources