How do i load non-tidyverse R package to Kaggle - r

I'm trying to upload a project that i worked on R, to Kaggle. But its refusing to load these packages
library(geosphere)
library(measurement)
It keeps giving me an error message -
Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified)
Then I have tried to download the latest R package from CRAN (R-4.2.1-win.exe), so i can manually specify the document path using the code below
install.packages("C:/Users/Da/Downloads/R-4.2.1-win.exe", repos = NULL, type = "source")
but that is not working as well. The error message is: -
Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is
unspecified)
Warning message in install.packages("‪C:/Users/Damilare/Downloads/R-4.2.1-win.exe", :
“installation of package ‘‪C:/Users/Da/Downloads/R-4.2.1-win.exe’ had non-zero exit status”
How do i load packages that are not a part of tidyverse to Kaggle?
Please help me, I'm new to Data Analytics.

Related

nbastatR not working in RStudio build 353

Whenever I try to run the code install.packages("nbastatR") the following error pops up:
Installing package into ‘AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘nbastatR’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at:
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
I tried downloading from the Github repos through:
install.packages('devtools', lib='~/R/lib')
devtools::install_github('abresler/nbastatR')
But still no success.
Error:
Warning in install.packages :
package ‘nbastatR’ is not available for this version of R

Trouble installing the package geoR (Windows)

it seems that the package "geoR" was removed from the repository.
So after trying to install it manually with:
install.packages(file.choose(), repos=NULL, type="source")
Installing package into "geoR_1.8-1.zip"(as ‘lib’ is unspecified)package 'geoR' successfully unpacked and MD5 sums checkedError in utils:::unpackPkgZip(pkg, pkg_name, lib, libs_only, lock, reuse_lockdir = reuse_lockdir) :package 'geoR' not installed because it is not built for UCRTWarning in install.packages :installation of package ‘geoR_1.8-1.zip’ had non-zero exit status
I have the latest version of R (4.2.0).
So I've tried another command:
install.packages("geoR_1.8-1.zip", repos = NULL, type = "win.binary")
Installing package into ‘libpath’(as ‘lib’ is unspecified)package ‘geoR’ successfully unpacked and MD5 sums checkedError in install.packages : package ‘geoR’ not installed because it is not built for UCRT
So how do I make it work?
I've already tried to uninstall R, Rstudio, Rtools42 and all the folders associated...
After a long try, I came up with this:
If I try to install an older version of geoR,
install.packages("geoR_1.7-5.2.tar.gz", repos = NULL, type = "source")
Installing package into ‘C:/Users/.../AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
ERROR: dependencies 'splancs', 'RandomFields' are not available for package 'geoR'
* removing 'C:/Users/..../AppData/Local/R/win-library/4.2/geoR'
Warning in install.packages :
installation of package ‘geoR_1.7-5.2.tar.gz’ had non-zero exit status
So this seems a dependancies issue, and after installing splancs correctly, RandomFields (manually because there is no repository for it) give me this output after a long string (maybe the compilation):
make: *** [C:/PROGRA~1/R/R-42~1.0/etc/x64/Makeconf:257: brownresnick.o] Error 1
ERROR: compilation failed for package 'RandomFields'
* removing 'C:/Users/.../AppData/Local/R/win-library/4.2/RandomFields'
Warning message:
In install.packages(file.choose()) :
installation of package ‘C:/Users/rmish/Downloads/RandomFields_3.3.tar.gz’ had non-zero exit status
Somebody wants to help me?
Thanks in advance, I'm really stuck.
Both RandomFields and geoR are no longer available on CRAN, so you'll have to download their respective tar files. You'll also need to install the splancs package, which is available on CRAN.
install.packages("splancs")
Download the two other packages here:
http://www2.uaem.mx/r-mirror/src/contrib/RandomFields_2.0.66.tar.gz
https://cran.r-project.org/src/contrib/Archive/geoR/geoR_1.8-1.tar.gz
Install RandomFields first:
install.packages("C:/path/to/RandomFields_2.0.66.tar.gz", repos = NULL, type = "source")
And then geoR:
install.packages("C:/path/to/geoR_1.8-1.tar.gz", repos = NULL, type = "source")

Using USABoundaries

I'm trying to use the USABoundaries package to draw maps and am having trouble downloading UsaBoundariesData. When I enter something like this
library(USAboundaries)
OH_cong <- us_congressional(states = "OH", resolution = "high")
I get this error message:
The USAboundariesData package needs to be installed.
Install the USAboundariesData package?
1: Yes
2: No
Selection: Yes
Installing the USAboundariesData package.
Installing package into ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
Error in value[[3L]](cond) :
Failed to install the USAboundariesData package.
Please try installing the package for yourself using the following command:
install.packages("USAboundariesData", repos = "http://packages.ropensci.org", type = "source")
> install.packages("USAboundariesData", repos = "http://packages.ropensci.org", type = "source")
Installing package into ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
Error in install.packages : error reading from connection
If anyone has any useful info that would be much appreciated!
Try this instead:
devtools::install_github("ropensci/USAboundariesData")

Cannot Install RADammi package

I am trying to install the RADammi package on R 3.6 using "devtools", however I receive this error:
Installing package into ‘C:/Users/taham/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
ERROR: dependencies 'Biostrings', 'IRanges' are not available for package 'RADami'
* removing 'C:/Users/taham/Documents/R/win-library/3.6/RADami'
Error: Failed to install 'unknown package' from URL:
(converted from warning) installation of package > ‘C:/Users/taham/AppData/Local/Temp/RtmpycMnQ2/remotes11246cb38f0/RADami’ had non-zero exit status.
It is an old package that has been removed from CRAN
https://rdrr.io/cran/RADami/
how should I install it?
update:
I finally could manage to install the two dependencies using below command:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Biostrings")
BiocManager::install("IRanges")
I have downloaded the zip archived RADami file and tried to install the package, I receive this fetal error again:
install.packages("C:/Users/taham/Downloads/RADami_1.1-2.tar.gz", repos = NULL, type = "source")
Installing package into ‘C:/Users/taham/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
installing source package 'RADami' ...
** package 'RADami' successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error: objects 'c.phylo', 'c.multiPhylo' are not exported by 'namespace:ape'
Execution halted
ERROR: lazy loading failed for package 'RADami'
removing 'C:/Users/taham/Documents/R/win-library/3.6/RADami'
Warning in install.packages :
installation of package ‘C:/Users/taham/Downloads/RADami_1.1-2.tar.gz’ had non-> zero exit status
I get the same error when using devtools
It sounds like you need to first install "IRanges" and "Biostrings" from BioConductor:
library(devtools)
install_bioc("IRanges")
install_bioc("Biostrings")
Though these have other dependencies such as "S4Vector" which you may need to install manually also.
Then you should be able to install RADami:
install_url("https://cran.r-project.org/src/contrib/Archive/RADami/RADami_1.0-3.tar.gz")
I also had this issue with installing from the CRAN archive, but was successfully able to install it from the developer's Github. In R:
library(devtools)
install_github("andrew-hipp/RADami")

R: What can not install package?

I have a problem for installing each package in R. for example When I type:
install.packages("rvest")
I see:
Installing package into ‘/home/farzad/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rvest’ is not available (for R version 3.2.3)
This is for installing all packages. What should I do?

Resources