cannot authenticate r shinyapps account with rsconnect - r

Trying to install reconnect and authenticate it with R-shiny. However, it seems unable to find the function file size.
Here is the installation:
> install.packages("rsconnect", type = "source", dependencies = TRUE, repos = "http://cran.rstudio.com/")
Installing package into ‘/Users/~/Library/R/3.1/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/rsconnect_0.8.8.tar.gz'
Content type 'application/x-gzip' length 245177 bytes (239 Kb)
opened URL
==================================================
downloaded 239 Kb
* installing *source* package ‘rsconnect’ ...
** package ‘rsconnect’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (rsconnect)
The downloaded source packages are in
/private/VAb/downloaded_packages
Here is the error when I try to register my account.
rsconnect::setAccountInfo(name='me',
+ token='token',
+ secret='pass')
Error in inferCertificateContents(system.file("cert/shinyapps.io.pem", :
could not find function "file.size"

Related

Error message when installing package expss

I'm trying to download the package 'expss' in R, but I get an error message that I don't know how to solve.
This is what R tells me after trying to install 'expss':
installing the source package ‘expss’
trying URL 'https://cran.rstudio.com/src/contrib/expss_0.11.2.tar.gz'
Content type 'application/x-gzip' length 5002788 bytes (4.8 MB)
==================================================
downloaded 4.8 MB
* installing *source* package ‘expss’ ...
** package ‘expss’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
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-arm64/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/86/04fdfqg9769g8w7ss25qnw600000gn/T/RtmpELbScA/downloaded_packages’
Any help appreciated!

How can I use R function download.file?

I've tried to run this command:
url <- 'http://www.rob-mcculloch.org/chm/nonlinvarsel_0.0.1.9001.tar.gz'
download.file(url, destfile = 'temp')
install.packages('temp', repos = NULL, type='source')
But at first, when I ran download.file, that returned me:
Warning messages: 1: In download.file(url, destfile = "temp") : URL http://www.rob-mcculloch.org/chm/nonlinvarsel_0.0.1.9001.tar.gz: cannot open destfile 'temp', reason 'Is a directory' 2: In download.file(url, destfile = "temp") : download had nonzero exit status
So I tried to run install.packages and that returned me:
Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) Warning: invalid package ‘temp’ Error: ERROR: no packages specified Warning message: In install.packages("temp", repos = NULL, type = "source") : installation of package ‘temp’ had non-zero exit status
You don't have to do it from inside R (though that is doable, just look more close at options and see below). I actually like the shell for this:
/tmp> wget http://www.rob-mcculloch.org/chm/nonlinvarsel_0.0.1.9001.tar.gz
--2022-04-11 03:03:59-- http://www.rob-mcculloch.org/chm/nonlinvarsel_0.0.1.9001.tar.gz
Resolving www.rob-mcculloch.org (www.rob-mcculloch.org)... 162.241.219.65
Connecting to www.rob-mcculloch.org (www.rob-mcculloch.org)|162.241.219.65|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20001 (20K) [application/x-gzip]
Saving to: ‘nonlinvarsel_0.0.1.9001.tar.gz’
nonlinvarsel_0.0.1.9001.tar.gz 100%[=====================================================================================================================>] 19.53K --.-KB/s in 0.03s
2022-04-11 03:03:59 (634 KB/s) - ‘nonlinvarsel_0.0.1.9001.tar.gz’ saved [20001/20001]
/tmp> R CMD INSTALL nonlinvarsel_0.0.1.9001.tar.gz
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘nonlinvarsel’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** 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
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (nonlinvarsel)
/tmp>
Or equally within R (where I also switch to /tmp) first:
> setwd("/tmp")
> download.file("http://www.rob-mcculloch.org/chm/nonlinvarsel_0.0.1.9001.tar.gz", "nonlinvarsel_0.0.1.9001.tar.gz")
trying URL 'http://www.rob-mcculloch.org/chm/nonlinvarsel_0.0.1.9001.tar.gz'
Content type 'application/x-gzip' length 20001 bytes (19 KB)
==================================================
downloaded 19 KB
> install.packages("nonlinvarsel_0.0.1.9001.tar.gz", repos = NULL)
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘nonlinvarsel’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** 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
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (nonlinvarsel)
>

Getting an error message when installing psych package

The message I get:
Installing psych:
Installing package into 'C:/.../Documents/R/win-library/4.0'
(as 'lib' is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
psych 2.1.9 2.2.3 FALSE
installing the source package 'psych'
trying URL 'https://cran.rstudio.com/src/contrib/psych_2.2.3.tar.gz'
Content type 'application/x-gzip' length 1928530 bytes (1.8 MB)
==================================================
downloaded 1.8 MB
* installing *source* package 'psych' ...
** package 'psych' successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error: unexpected symbol in "tools:::makeLazyLoading("psych", 'C:..."
Execution halted
ERROR: lazy loading failed for package 'psych'
* removing '.../Documents/R/win-library/4.0/psych'
The downloaded source packages are in
'C:...Temp\Rtmpe405Ws\downloaded_packages'
<U+2714> Package 'psych' successfully installed.
Warning message:
In utils::install.packages("psych", repos = "https://cran.rstudio.com/") :
installation of package 'psych' had non-zero exit status

Can't install plotKML package in R

I have tried to install plotKML package, but it raises the next error. I can't see any missing dependencies and I don't know what's wrong.
> install.packages("plotKML")
Installing package into ‘/home/benmhamed/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/plotKML_0.6-1.tar.gz'
Content type 'application/x-gzip' length 3448310 bytes (3.3 MB)
==================================================
downloaded 3.3 MB
* installing *source* package ‘plotKML’ ...
** package ‘plotKML’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
double free or corruption (!prev)
Aborted (core dumped)
ERROR: lazy loading failed for package ‘plotKML’
* removing ‘/home/benmhamed/R/x86_64-pc-linux-gnu-library/4.0/plotKML’
Warning in install.packages :
installation of package ‘plotKML’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpu5ujGk/downloaded_packages’

Why R packages are removed after updating them?

I was trying to update some R packages since RStudio showed they could be updated. After updating, two packages are simply removed. (rgdal and spatstat). The same thing has happened several times recently. What is happening here?
> install.packages(c("data.table", "rgdal", "spatstat"))
Installing packages into ‘C:/Users/Patrick/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘spatstat.data’
There is a binary version available but the source version is later:
binary source needs_compilation
spatstat.data 1.1-0 1.1-1 FALSE
trying URL 'https://mirror.las.iastate.edu/CRAN/bin/windows/contrib/3.4/data.table_1.10.4-1.zip'
Content type 'application/zip' length 1577319 bytes (1.5 MB)
downloaded 1.5 MB
trying URL 'https://mirror.las.iastate.edu/CRAN/bin/windows/contrib/3.4/rgdal_1.2-13.zip'
Content type 'application/zip' length 30475771 bytes (29.1 MB)
downloaded 29.1 MB
trying URL 'https://mirror.las.iastate.edu/CRAN/bin/windows/contrib/3.4/spatstat_1.53-2.zip'
Content type 'application/zip' length 14521163 bytes (13.8 MB)
downloaded 13.8 MB
package ‘data.table’ successfully unpacked and MD5 sums checked
package ‘rgdal’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘rgdal’
package ‘spatstat’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘spatstat’
The downloaded binary packages are in
C:\Users\Patrick\AppData\Local\Temp\RtmpeaKi0Y\downloaded_packages
installing the source package ‘spatstat.data’
trying URL 'https://mirror.las.iastate.edu/CRAN/src/contrib/spatstat.data_1.1-1.tar.gz'
Content type 'application/x-gzip' length 2837063 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'spatstat.data' ...
** package 'spatstat.data' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (spatstat.data)
The downloaded source packages are in
‘C:\Users\Patrick\AppData\Local\Temp\RtmpeaKi0Y\downloaded_packages’
> library(rgdal)
Error in library(rgdal) : there is no package called ‘rgdal’
> library(spatstat)
Error in library(spatstat) : there is no package called ‘spatstat’
You can find the directory that contains your installed packages with
.libPaths()
Which should give you something like:
"/Library/Frameworks/R.framework/Versions/3.3/Resources/library"
If you see rgdal or spatstat there I would delete them and then try installing again.

Resources