When Running R Code From Terminal Packages Will Not Load Properly - r

I am currently working on an R code that uses the YAML package to create a config file. I need to import and use certain packages like any other code but for some reason when I try to run the program on my server at work it does not work properly. I have 4 packages I need but I went ahead an ran the code with just lubridate to keep the output short. If I can load lubridate I am sure I can load the others too.
Here is what I get from the terminal and after that is my code. I know its a bit messy but I am just trying to get it to work right now.
Terminal output: PS I cant post more than 2 links so I am cutting the output some
unable to load shared object '/nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so':
/lib64/libc.so.6: version `GLIBC_2.7' not found (required by /nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so)
ERROR: lazy loading failed for package ‘evaluate’
* removing ‘/nfs/aer/prg/r/lib-linux-x86_64/evaluate’
* restoring previous ‘/nfs/aer/prg/r/lib-linux-x86_64/evaluate’
ERROR: failed to lock directory ‘/nfs/aer/prg/r/lib-linux-x86_64’ for modifying
Try removing ‘/nfs/aer/prg/r/lib-linux-x86_64/00LOCK-lubridate’
* installing *source* package ‘knitr’ ...
** package ‘knitr’ successfully unpacked and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so':
/lib64/libc.so.6: version `GLIBC_2.7' not found (required by /nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so)
Error : unable to load R code in package ‘knitr’
ERROR: lazy loading failed for package ‘knitr’
* removing ‘/nfs/aer/prg/r/lib-linux-x86_64/knitr’
installation of package ‘knitr’ had non-zero exit status
Error in library(lubridate) : there is no package called ‘lubridate’
Execution halted
Code:
#install.packages('lubridate', repos="http://cran.rstudio.com/")
#install.packages('ggplot2', repos="http://cran.rstudio.com/")
#install.packages('plyr', repos="http://cran.rstudio.com/")
#install.packages('yaml', repos="http://cran.rstudio.com/")
install.packages('lubridate', dependencies = TRUE, repos="http://cran.rstudio.com/")
#install.packages("lubridate", repos="http://cran.rstudio.com/")
#install.packages('ggplot2', dependencies = TRUE, repos="http://cran.rstudio.com/")
#install.packages('plyr', dependencies = TRUE, repos="http://cran.rstudio.com/")
#install.packages('yaml', dependencies = TRUE, repos="http://cran.rstudio.com/")
library(lubridate)
#library(lubridate, lib.loc="Y:/work/anne/bin/R Library")
#library(ggplot2)
#library(plyr)
#library(yaml)
#install.packages("lubridate", repos = "http://cran.rstudio.com/", type="source")
#require(lubridate)
#require(ggplot2)
#require(plyr)
#require(yaml)
# install.packages("lubridate", repos="C:/Users/hadi/Documents/R/R-3.1.1/library")
#library("lubridate")
#install.packages("ggplot2", repos="http://cran.rstudio.com/")
#library("ggplot2")
#install.packages("plyr", repos="http://cran.rstudio.com/")
#library("plyr")
#install.packages("yaml", repos="http://cran.rstudio.com/")
#library("yaml")
#install_github("lubridate")
#install_github("ggplot2")
#install_github("plyr")
#install_github("yaml")
#Set Working Directory
#setwd('~/Desktop/Front End Testing/Binning Data')######
#Read Config File
config = yaml.load_file('BinConfig.yaml')
#Create Dataframe of the data
dataframe<-read.csv(config$db$dataframe)
#Filter up to 5 Variables at a time or as few as 1 or even 0 variables
dataframe<-dataframe[which(dataframe[config$db$filter1VarName]>=config$db$filter1greaterthanorequalto),]
dataframe<-dataframe[which(dataframe[config$db$filter1VarName]<=config$db$filter1lessthanorequalto),]
dataframe<-dataframe[which(dataframe[config$db$filter2VarName]>=config$db$filter2greaterthanorequalto),]
dataframe<-dataframe[which(dataframe[config$db$filter2VarName]<=config$db$filter2lessthanorequalto),]
#If you do not need this many filters just leave as is with "#" in front. You will get an error but it does not affect the program
dataframe<-dataframe[which(dataframe[config$db$filter3VarName]>=config$db$filter3greaterthanorequalto),]
dataframe<-dataframe[which(dataframe[config$db$filter3VarName]<=config$db$filter3lessthanorequalto),]
#If you do not need this many filters just leave as is with "#" in front. You will get an error but it does not affect the program
dataframe<-dataframe[which(dataframe[config$db$filter4VarName]>=config$db$filter4greaterthanorequalto),]
dataframe<-dataframe[which(dataframe[config$db$filter4VarName]<=config$db$filter4lessthanorequalto),]
#If you do not need this many filters just leave as is with "#" in front. You will get an error but it does not affect the program
dataframe<-dataframe[which(dataframe[config$db$filter5VarName]>=config$db$filter5greaterthanorequalto),]
dataframe<-dataframe[which(dataframe[config$db$filter5VarName]<=config$db$filter5lessthanorequalto),]
#Best kept small. This way if you have narrow bins you can still hit the min # of bins
xBinSize<-config$db$xMinBinSize;
#This is the number of bins you want provided the xBinSize allows for the number of bins
minXBins<- config$db$minXBins;
stationColors <- rainbow(length(stations));
plotX<-vector('list',length(stations));
plotY<-vector('list',length(stations));
stn<-stations
#dataframe<-subset(dataframe,ZAngSGR0_XI<2.7)
#Absorption_Angstrom_Exponent_BG_PM10
#For our application change these two red lines below to fit the column name you wissh to use. Name must be the same as in the data frame
rawX <- c(dataframe[paste(c(config$db$XVar), collapse="")][TRUE,1],
dataframe[paste(c(config$db$XVar), collapse="")][TRUE,1]);
rawY <- c(dataframe[paste(c(config$db$YVar), collapse="")][TRUE,1],
dataframe[paste(c(config$db$YVar), collapse="")][TRUE,1]);
dataX <- rawX[!is.na(rawX) & !is.na(rawY)];
dataY <- rawY[!is.na(rawX) & !is.na(rawY)];
# Figure out the bin range and bin size
rX <- range(dataX);
useBinSize <- xBinSize;
rX[1] <- floor(rX[1] / useBinSize) * useBinSize;
rX[2] <- ceiling(rX[2] / useBinSize) * useBinSize;
if ((rX[2] - rX[1]) > useBinSize * minXBins) {
rX <- range(dataX);
useBinSize <- (rX[2] - rX[1]) / minXBins;
}# < useBinSize * minXBins
nBins <- (rX[2] - rX[1]) / useBinSize ;
# Bin the data
bins <- seq(rX[1],rX[2], useBinSize);
outY <- seq(1,nBins);
outX <- seq(1,nBins);#bins
rows<-length(dataX)
outXBin1<-NULL
outXBindims=NULL
for (bin in seq(1,nBins)) {
outY[bin] <- mean(dataY[dataX>=bins[bin] & dataX<bins[bin+1]],na.rm=T);
outXBin1[bin] <- as.data.frame(dataX[dataX>=bins[bin] & dataX<bins[bin+1]]);
outXBindims[bin]<-length(outXBin1[[bin]])
#outYBinF[,bin] <- (dataY[dataX>=bins[bin] & dataX<bins[bin+1]]);
outX[bin] <- mean(c(bins[bin], bins[bin+1]));
#outXBinF[,bin] <- (c(bins[bin], bins[bin+1]));
}
plotX <- data.frame(outX[!is.na(outY)]);
plotY <- data.frame(outY[!is.na(outY)]);
weight<-data.frame(outXBindims[!is.na(outY)]);
DF<-cbind(plotX,plotY,weight)
names(DF)[names(DF)=='outX..is.na.outY..']<-config$db$XVar
names(DF)[names(DF)=='outY..is.na.outY..']<-config$db$YVar
names(DF)[names(DF)=='outXBindims..is.na.outY..']<-config$db$Y2Var
#DF$FrequencyPercent<-(DF[config$db$Y2Var]/(sum(DF[config$db$Y2Var]))*100)
#names(DF)[names(DF)=='FrequencyPercent']<-c("Frequency Percent")
write.csv(DF,config$db$BinnedDataName)

So I ran it with just install.packages() and library.... This is what I got as the error: P.S. I do not have enough reputation to post more than 2 links so I went ahead and make the https htps instead so I can still post the entire thing...
Installing package into ‘/nfs/aer/prg/r/lib-linux-x86_64’
(as ‘lib’ is unspecified)
also installing the dependencies ‘evaluate’, ‘knitr’
trying URL 'htp://cran.rstudio.com/src/contrib/evaluate_0.10.tar.gz'
Content type 'application/x-gzip' length 21914 bytes (21 KB)
downloaded 21 KB
trying URL 'htp://cran.rstudio.com/src/contrib/knitr_1.15.1.tar.gz'
Content type 'application/x-gzip' length 1027808 bytes (1003 KB)
downloaded 1003 KB
trying URL 'htp://cran.rstudio.com/src/contrib/lubridate_1.6.0.tar.gz'
Content type 'application/x-gzip' length 317672 bytes (310 KB)
downloaded 310 KB
installing source package ‘evaluate’ ...
** package ‘evaluate’ successfully unpacked and MD5 sums checked
** R
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so':
/lib64/libc.so.6: version `GLIBC_2.7' not found (required by /nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so)
ERROR: lazy loading failed for package ‘evaluate’
removing ‘/nfs/aer/prg/r/lib-linux-x86_64/evaluate’
restoring previous ‘/nfs/aer/prg/r/lib-linux-x86_64/evaluate’
ERROR: failed to lock directory ‘/nfs/aer/prg/r/lib-linux-x86_64’ for modifying
Try removing ‘/nfs/aer/prg/r/lib-linux-x86_64/00LOCK-lubridate’
installing source package ‘knitr’ ...
** package ‘knitr’ successfully unpacked and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so':
/lib64/libc.so.6: version `GLIBC_2.7' not found (required by /nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so)
Error : unable to load R code in package ‘knitr’
ERROR: lazy loading failed for package ‘knitr’
removing ‘/nfs/aer/prg/r/lib-linux-x86_64/knitr’
The downloaded source packages are in
‘/tmp/RtmpDtWu7K/downloaded_packages’
Warning messages:
1: In install.packages("lubridate", dependencies = TRUE, repos = "htp://cran.rstudio.com/") :
installation of package ‘evaluate’ had non-zero exit status
2: In install.packages("lubridate", dependencies = TRUE, repos = "htp://cran.rstudio.com/") :
installation of package ‘lubridate’ had non-zero exit status
3: In install.packages("lubridate", dependencies = TRUE, repos = "htp://cran.rstudio.com/") :
installation of package ‘knitr’ had non-zero exit status
Error in library(lubridate) : there is no package called ‘lubridate’
Execution halted
[climate:/aer/work/anne/bin]$ R --slave -f Bin.r
Installing package into ‘/nfs/aer/prg/r/lib-linux-x86_64’
(as ‘lib’ is unspecified)
also installing the dependencies ‘evaluate’, ‘knitr’
trying URL 'htp://cran.rstudio.com/src/contrib/evaluate_0.10.tar.gz'
Content type 'application/x-gzip' length 21914 bytes (21 KB)
downloaded 21 KB
trying URL 'htp://cran.rstudio.com/src/contrib/knitr_1.15.1.tar.gz'
Content type 'application/x-gzip' length 1027808 bytes (1003 KB)
downloaded 1003 KB
trying URL 'htp://cran.rstudio.com/src/contrib/lubridate_1.6.0.tar.gz'
Content type 'application/x-gzip' length 317672 bytes (310 KB)
downloaded 310 KB
installing source package ‘evaluate’ ...
** package ‘evaluate’ successfully unpacked and MD5 sums checked
** R
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so':
/lib64/libc.so.6: version `GLIBC_2.7' not found (required by /nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so)
ERROR: lazy loading failed for package ‘evaluate’
removing ‘/nfs/aer/prg/r/lib-linux-x86_64/evaluate’
restoring previous ‘/nfs/aer/prg/r/lib-linux-x86_64/evaluate’
ERROR: failed to lock directory ‘/nfs/aer/prg/r/lib-linux-x86_64’ for modifying
Try removing ‘/nfs/aer/prg/r/lib-linux-x86_64/00LOCK-lubridate’
installing source package ‘knitr’ ...
** package ‘knitr’ successfully unpacked and MD5 sums checked
** R
** demo
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so':
/lib64/libc.so.6: version `GLIBC_2.7' not found (required by /nfs/aer/prg/r/lib-linux-x86_64/stringi/libs/stringi.so)
Error : unable to load R code in package ‘knitr’
ERROR: lazy loading failed for package ‘knitr’
removing ‘/nfs/aer/prg/r/lib-linux-x86_64/knitr’
The downloaded source packages are in
‘/tmp/RtmpJUL44H/downloaded_packages’
Warning messages:
1: In install.packages("lubridate", dependencies = TRUE, repos = "htp://cran.rstudio.com/") :
installation of package ‘evaluate’ had non-zero exit status
2: In install.packages("lubridate", dependencies = TRUE, repos = "htp://cran.rstudio.com/") :
installation of package ‘lubridate’ had non-zero exit status
3: In install.packages("lubridate", dependencies = TRUE, repos = "htp://cran.rstudio.com/") :
installation of package ‘knitr’ had non-zero exit status
Error in library(lubridate) : there is no package called ‘lubridate’
Execution halted
Thank you for your patience

Related

Dependency error when install ggplot in R

When I try to install ggplot with this code
install.packages("png")
install.packages("RgoogleMaps")
install.packages("ggmap")
library(ggmap)
It returns error
installing to /usr/local/Cellar/r/4.2.2/lib/R/library/00LOCK-png/00new/png/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘png’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/local/Cellar/r/4.2.2/lib/R/library/00LOCK-png/00new/png/libs/png.so':
dlopen(/usr/local/Cellar/r/4.2.2/lib/R/library/00LOCK-png/00new/png/libs/png.so, 6): Library not loaded: #rpath/libz.1.dylib
Referenced from: /usr/local/Cellar/r/4.2.2/lib/R/library/00LOCK-png/00new/png/libs/png.so
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/Cellar/r/4.2.2/lib/R/library/png’
Warning in install.packages :
installation of package ‘png’ had non-zero exit status
ERROR: dependency ‘png’ is not available for package ‘RgoogleMaps’
* removing ‘/usr/local/Cellar/r/4.2.2/lib/R/library/RgoogleMaps’
Warning in install.packages :
installation of package ‘RgoogleMaps’ had non-zero exit status
ERROR: dependencies ‘RgoogleMaps’, ‘png’ are not available for package ‘ggmap’
* removing ‘/usr/local/Cellar/r/4.2.2/lib/R/library/ggmap’
Warning in install.packages :
installation of package ‘ggmap’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/fd/7vyffy191_l3j6fhyqbvsn0r0000gn/T/RtmptKSXHF/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Error in library(ggmap) : there is no package called ‘ggmap’
I am installing all the dependencies that the error says are missing. By adding the install packages before installing the ggmap itself.

Cannot install tmap tmaptools, Error unable to load shared object lwgeom.so': libproj.so.19

I cannot install the R packages tmaptools and tmap in ubuntu linux, I have followed the instructions in
https://geocompr.github.io/post/2020/installing-r-spatial-ubuntu/
I installed sf and checked:
library(sf)
Linking to GEOS 3.10.1, GDAL 3.4.0, PROJ 8.2.0; sf_use_s2() is TRUE
Warning messages:
1: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘pillar’
2: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘tibble’
When I try to instal tmaptools the following error appears
> install.packages("tmaptools")
Installing package into ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/tmaptools_3.1-1.tar.gz'
Content type 'application/x-gzip' length 40116 bytes (39 KB)
==================================================
downloaded 39 KB
* installing *source* package ‘tmaptools’ ...
** package ‘tmaptools’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Warning: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘pillar’
Warning: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘tibble’
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1/lwgeom/libs/lwgeom.so':
libproj.so.19: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘tmaptools’
* removing ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1/tmaptools’
Warning in install.packages :
installation of package ‘tmaptools’ had non-zero exit status
I have already removed the package and installed it again, but I always get the same error.
Browsing the tmap issues on github I found the answer:
install lwgeom package, so
install.packages("lwgeom")
Solved the problem.

Why is the ggplot2 installation failing?

I'm trying to install the ggplot2 package, so that I make use of ggplot function for my graphs but it keeps failing me. Where is the problem?
> install.packages("ggplot2")
Installing package into ‘C:/Users/Augustinho/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
ggplot2 3.3.0 3.3.1 FALSE
installing the source package ‘ggplot2’
trying URL 'https://cran.stat.unipd.it/src/contrib/ggplot2_3.3.1.tar.gz'
Content type 'application/octet-stream' length 3035612 bytes (2.9 MB)
downloaded 2.9 MB
* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error : .onLoad failed in loadNamespace() for 'pillar', details:
call: utils::packageVersion("vctrs")
error: package 'vctrs' not found
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/Augustinho/Documents/R/win-library/3.5/ggplot2'
In R CMD INSTALL
The downloaded source packages are in
‘C:\Users\Augustinho\AppData\Local\Temp\RtmpM7MaYn\downloaded_packages’
Warning messages:
1: In readRDS(dest) : lzma decoding result 10
2: In install.packages("ggplot2") :
installation of package ‘ggplot2’ had non-zero exit status
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
As you are on Windows, try to install the binary version with dependencies:
install.packages("ggplot2",
type = "binary",
dependencies = TRUE,
repos = "https://cloud.r-project.org")
Edit:
Helped first running:
install.packages("vctrs", type = "binary", dependencies = TRUE, repos = "https://cloud.r-project.org")
to skip some vctrs installation error.

Error: package or namespace load failed for ‘intsvy’

I am using RStudio Version 1.0.136 – © 2009-2016 RStudio, Inc. I checked for a new update and I received a massege that saying "You're using the newest version of RStudio".
Here I am trying to use R ‘intsvy’ package.
I started by setting up the directory.
Then, first I installed the package by using the following code:
install.packages("intsvy", lib="/Library/Frameworks/R.framework/Versions/3.3/Resources/library")
Below is the Console results
There is a binary version available but the source version is later:
binary source needs_compilation
intsvy 2.1 2.4 FALSE
installing the source package ‘intsvy’
trying URL 'https://cran.rstudio.com/src/contrib/intsvy_2.4.tar.gz'
Content type 'application/x-gzip' length 56777 bytes (55 KB)
==================================================
downloaded 55 KB
starting R..
* installing *source* package ‘intsvy’ ...
** package ‘intsvy’ successfully unpacked and MD5 sums checked
** 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]]) :
there is no package called ‘repr’
ERROR: lazy loading failed for package ‘intsvy’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/intsvy’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/intsvy’
Warning in install.packages :
installation of package ‘intsvy’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T/RtmppVfRws/downloaded_packages’
Second, I installed the package by using the following code after receiving the above long massage:
install.packages("intsvy")
Below is the Console results
Installing package into ‘/Users/HU-Hisham/Library/R/3.3/library’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
intsvy 2.1 2.4 FALSE
installing the source package ‘intsvy’
trying URL 'https://cran.rstudio.com/src/contrib/intsvy_2.4.tar.gz'
Content type 'application/x-gzip' length 56777 bytes (55 KB)
==================================================
downloaded 55 KB
starting R..
* installing *source* package ‘intsvy’ ...
** package ‘intsvy’ successfully unpacked and MD5 sums checked
** 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]]) :
there is no package called ‘repr’
ERROR: lazy loading failed for package ‘intsvy’
* removing ‘/Users/HU-Hisham/Library/R/3.3/library/intsvy’
Warning in install.packages :
installation of package ‘intsvy’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T/RtmppVfRws/downloaded_packages’
Next #load backage
library("intsvy")
Below are the massages I received in the Console
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘repr’
In addition: Warning message:
package ‘intsvy’ was built under R version 3.3.2
Error: package or namespace load failed for ‘intsvy’
After installations, I tried to run the following command
pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"),
+ name = "Variable labels", output = getwd())
Here is the massage
Error: could not find function "pirls.var.label"
Function pirls.var.label is one of the functions in the 'intsvy' package.
Why am I receiving this error? Is it because the package not successfully installed? How can I take care or this matter and start using the package and data? Please advice.
I updated my R version from R3.3.1 (2016-06-21) to R3.6.2 (2019-12-12)as some experts recommended.
Then I run the commands again after restarting R:
1 installing repr package
> install.packages("repr")
Warning in install.packages :
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES.rds': HTTP status was '404 Not Found'
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/repr_1.0.2.tgz'
Content type 'application/x-gzip' length 118906 bytes (116 KB)
==================================================
downloaded 116 KB
The downloaded binary packages are in
/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T//Rtmpt0mup2/downloaded_packages
Warning message:
R graphics engine version 12 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.
2 installing intsvy package
> install.packages("intsvy", dependencies = T)
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/intsvy_2.4.tgz'
Content type 'application/x-gzip' length 336356 bytes (328 KB)
==================================================
downloaded 328 KB
The downloaded binary packages are in
/var/folders/jj/3brk8hp91ps2mdv6gzlynh6r0000gn/T//Rtmpt0mup2/downloaded_packages
load backage
> library("intsvy")
Error: package or namespace load failed for ‘intsvy’:
.onLoad failed in loadNamespace() for 'pillar', details:
call: utils::packageVersion("vctrs")
error: there is no package called ‘vctrs’
> library(intsvy)
Error: package or namespace load failed for ‘intsvy’:
.onLoad failed in loadNamespace() for 'pillar', details:
call: utils::packageVersion("vctrs")
error: there is no package called ‘vctrs’
Still same errors when I try to run the package commands
> pisa.var.lable(folder="~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav")
Error in pisa.var.lable(folder = "~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav") :
could not find function "pisa.var.lable"
> pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"),
+ name = "Variable labels", output = getwd())
Error in pirls.var.label(folder = getwd("~/Desktop/Dr. Kato/Data/PISA/CY07_MSU_STU_QQQ.sav"), :
could not find function "pirls.var.label"
If you have an idea, please share it here so I can try it to solve this issue and start using the package and PISA data.
Thank you

How to fix the installation error with 'car' package

I am getting the below error while trying to install the 'car' package in R. Is there anything wrong I am doing here?
trying URL 'https://cran.rstudio.com/src/contrib/car_3.0-2.tar.gz'
Content type 'application/x-gzip' length 447952 bytes (437 KB)
downloaded 437 KB
* installing source package 'car' ...
** package 'car' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
Warning: package 'carData' was built under R version 3.5.2
Warning in fun(libname, pkgname) :
bytecode version mismatch; using eval
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/33904/Documents/R/win-library/3.3/data.table/libs/x64/datatable.dll':
LoadLibrary failure: The specified procedure could not be found.
ERROR: lazy loading failed for package 'car'
* removing 'C:/Users/33904/Documents/R/win-library/3.3/car'
* restoring previous 'C:/Users/33904/Documents/R/win-library/3.3/car'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\33904\Documents\R\win-library\3.3" C:\Users\33904\AppData\Local\Temp\Rtmpm23nOy/downloaded_packages/car_3.0-2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘car’ had non-zero exit status

Resources