Installing tidyjson via CRAN or Devtools - r

I'm trying to install tidyjson. I looked up CRAN itself, and it appears that tidyjson has been removed from CRAN, but archives still exist and two github repositories still exist holding the package (colearendt/tidyjson and sailthru/tidyjson).
However, I'm having issues downloading the package, either using install.packages or devtools::install_github().
install.packages("tidyjson") produces a warning: package ‘tidyjson’ is not available (for R version 3.6.1)
devtools::install_github() produces an error Error: Failed to install 'tidyjson' from GitHub: (converted from warning) cannot remove prior installation of package ‘rlang’. I get the same error regardless of which of the two repositories I download from.
In neither case does library(tidyjson) then load the package - it is stated not to exist.

Managed to solve this problem by uninstalling and reinstalling rlang through CRAN - the error then occurred for digest. Once I uninstalled and reinstalled devtools::install_github() worked as expected.

Related

How to solve expss package loading problem

I would like to install the expss package but it keeps returning an error.
Looked around for other with similar problems and tried re-installing several packages but nothing seems to work. Does anyone have a suggestion how to fixed the problem?
So far i tried re-installing:
install.packages("stringr")
install.packages("knitr")
install.packages("checkmate")
install.packages("htmlwidgets")
install.packages("htmltools")
install.packages("htmlTable")
install.packages("expss")
But Rstudio keeps returning with and error :
Error: package or namespace load failed for ‘expss’:
object 'mtfrm' not found whilst loading namespace 'expss'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/expss’
Warning in install.packages :
installation of package ‘expss’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/cl/5_wnd4b14y7b40zc80n1r3wdkcnbkn/T/RtmpdcLWsn/downloaded_packages’
According to this issue, the current version of expss won't install in versions of R before 4.2. This has recently been fixed in the development version. You could try:
updating your version of R to version 4.2 (probably the simplest solution if you don't need to keep an older version of R)
installing the development version of expss from GitHub: first install the remotes package, then remotes::install_github("gdemin/expss")
install an older version of expss (remotes::install_version("expss", "0.11.1"))

Can't install 'usethis' package

I'm using R-4.1.1 and the last version of Rstudio.
My goal is to use the ggradar package but I cannot install it with install.packages because:
le package ‘ggradar’ is not available for this version of R
So I would like to install the application like this:
devtools::install_github("ricardo-bion/ggradar", dependencies=TRUE)
I managed to install devtools but when I try to:
library(devtools)
there is this error:
Error: le package ‘usethis’ nécessaire pour ‘devtools’, mais est introuvable
When I trying to install devtools with
install.packages("devtools",dependencies =TRUE)
it doesn't work. So finally, I try to install the package usethis
install.packages("usethis")
but I can't do it: I have a big error which ends with:
Warning in install.packages :
installation of package ‘usethis’ had non-zero exit status
Can you help me please?
I don't know the exact reason for your case, but things like this can happen as a result of an inconsistent package set. It is in general a good idea to update installed packages before installing new ones.
As you have seen, package usethis depends on devtools, see: https://CRAN.R-project.org/package=usethis that also shows that usethis is availabe for R 4.1.1.
In inconsistency already happened, i.a. due to an upgrade from R 4.1.0 or other installations, de-installation of the suspect packages, or just deletion of the user library can help in most cases.
How to do this depends on the operating system.

An error when trying to install a package related to R version

I am trying to install the package ggpubr using the command install.packages('ggpubr') but I'm getting the error:
Installing package into ‘/home/nasser/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘cowplot’ is not available
I then tried to install the package cowplot using install.packages('cowplot') command and again I got the following error Warning in install.packages : package ‘cowplot’ is not available (for R version 3.4.4)
I searched for a solution and found a suggestion to use the following command:
devtools::install_github("wilkelab/cowplot")
and I got this error ERROR: this R is version 3.4.4, package 'cowplot' requires R >= 3.5.0
After a long time searching for a solution, I ended up having no perfect solution.
Can you please suggest me a way to avoid this error?
You have version 3.4.4 of R installed. The package cowplot requires version 3.5.0 or higher. You must upgrade your version of R.
Sometimes this is not possible (such as on a work network). In these cases, an alternative is to install an older version of cowplot that does not have that requirement. Of course, this means you are using an older version of the package. Archives are available on CRAN for older package versions.
https://cran.r-project.org/src/contrib/Archive/cowplot/

R package updates

I have been having some issues accessing an updated version of a package in R.
On running a workflow for data analysis I got this error message:
library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.2.1 is already loaded, but >= 0.2.2 is required
I therefore tried to update both the "dplyr" and "rlang" packages.
On updating I get the messages:
Installing package into ‘C:/Users/tomsp/OneDrive/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cran.ma.imperial.ac.uk/bin/windows/contrib/3.5/rlang_0.2.2.zip'
Content type 'application/zip' length 820944 bytes (801 KB)
downloaded 801 KB
package ‘rlang’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘rlang’
The downloaded binary packages are in
C:\Users\tomsp\AppData\Local\Temp\RtmpmooXKa\downloaded_packages
However if I check the package using the code below it still has version 0.2.1
packageVersion("rlang")
[1] ‘0.2.1’
I checked my library paths and still have not managed to be run the latest version(0.2.2) of the package rlang.
Any advice of what I am doing wrong or how I can solve this?
Restart R and run install.packages again. On Windows, you can't update a package that's already loaded, if the package contains compiled C/C++/Fortran code. This includes dplyr and rlang.
To be doubly sure, before you run install.packages, go to your R packages directory (C:/Users/tomsp/OneDrive/Documents/R/win-library/3.5) and delete any zero-length files that are present. These are artifacts of failed install attempts and will break install.packages if present.
For any reason, at least in Windows, some R processes may still be running in background. Close your current R session, kill all processes related to R and try again.
If you are using Windows, check if the package you are trying to upgrade is available only as a source file.
If you try to install a package that needs compilation, you need the software Rtools. Download it on cran.r-project.org/bin/windows/Rtools/. Updating Rtools might also resolve your problem. The console message for a particular package is like that:
binary source needs_compilation
backports 1.2.0 1.2.1 TRUE
On Linux you don't need Rtools, but read the console output when you see an error when you try to install or update a package. If some software is missing, the error message on Linux is self-explanatory.
Deleted the entire library from R packages directory on my local computer. Installed again after terminating the session. Worked for me.

Unable to install new R packages in DSX Desktop

I've just installed DSX Desktop with RStudio. I'm unable to load new packages, e.g. lubridate, and get the error below. If I check for package updates, I get the message "all packages are up-to-date", but the error below suggests it needs a newer version of Rcpp.
installing to /user-home/_global_/R/lubridate/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘Rcpp’ 0.12.9.2 is already loaded, but >= 0.12.13 is required
ERROR: lazy loading failed for package ‘lubridate’
* removing ‘/user-home/_global_/R/lubridate’
Warning in install.packages :
installation of package ‘lubridate’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpIV4HWl/downloaded_packages’
I tried install.packages("Rcpp") which returned the message:
Error in unloadNamespace(pkg_name) :
namespace ‘Rcpp’ is imported by ‘httpuv’, ‘reshape2’, ‘tidyr’, ‘bindrcpp’, ‘tibble’, ‘htmltools’, ‘dplyr’, ‘plyr’ so cannot be unloaded
If I try remove.packages("Rcpp") or removing the packages above, I get the following message, and they remain in the Packages view.
Removing package from ‘/user-home/_global_/R’
(as ‘lib’ is unspecified)
Error in remove.packages : there is no package called ‘Rcpp’
Any advice please on how to proceed?
There seems to be a fundamental problem with RStudio. I encountered exactly the same problems you describe with the latest version (1.1.442). The problems are:
Packages viewed as out-of-date go into a loop when installing with a repeated error dialog box appearing.
The package version check refers out-of-date packages and will not install the current package versions showing on CRAN. This is due to RStudio pointing at a MRAN mirror that has old updates. This means that all packages stored there are out of date. You can see when the packages on MRAN were last updated here.
Removal of other packages (e.g. dependencies) doesn't work properly, and manual deletion of the folders doesn't solve the problem.
Inside Tools, Global options, Packages there is the ability to specify the mirror that should be used for package management. This doesn't seem to work.
I fixed my problem by going into R and performing a package update inside that. RStudio now uses the updated packages.
I have contacted RStudio about this and received the reply that they don't provide support for free versions of RStudio.
tl;dr: RStudio appears to be broken for updating packages. Use R itself for updates.
I was getting this error:
Windows 7, update.packages problem: “unable to move temporary installation”? Which I think was due to my antivirus, but not sure. MRAN version was 3.3.1 and this is what I would do to fix this error everytime I opened R-Studio and needed to install:
trace(utils:::unpackPkgZip, edit=TRUE)
# Edit line 142 - change Sys.sleep(2.5)
I was still having versioning issues with tidyverse, so looked around and decided to install the latest MRAN from Microsoft and that fixed all of my R-Studio versioning issues and install inssues. I had other issues where I was doing a work.
Version info:
Microsoft R Open 3.5.1
The enhanced R distribution from Microsoft
Default CRAN mirror snapshot taken on 2018-08-01.
Download Microsoft R Open 3.5.1

Resources