Unable to install quantreg package and update R version - r

I am using R version 3.3.1 on RStudio interface, and a Windows 10 OS. I was trying to install the 'quantreg' package for quantile regression, however I was getting the error message
Warning in install.packages :
InternetOpenUrl failed: 'The operation timed out'
Warning in install.packages :
downloaded length 180224 != reported length 1521162
Warning in install.packages :
package ‘quantreg’ is not available (for R version 3.3.1)
I repeated the process afterwards several times but got the last line of the above error all the time. Thinking it was due to using an older R version, I tried updating by installing the 'installr' package, but that too gave me the same error as above. I tried updating R from the Tools Menu, but it kept telling me that the current R version is the latest.
Also this is my first time here, so apologies if I've messed up the blockquoting.

You need to downgrade R.
Download an older version here (I recommend 3.2.5) and install.
Then (in R), go to Tools > Global Options > press the "Change" button.
Now simply select the version you want and restart R and try reinstalling the package.

Related

RStudio - Not able to install packages after reinstallation of R & constant working directory issues

I recently had to have a new laptop build at work and therefore reinstalled R and R Studio through a designated 'Company Portal' that did the software installation for me (this might be the problem). When now trying to install and load packages for use, I am running in to the below error for packages (in this case for tidyverse):
Warning message: In options(stringsAsFactors = TRUE) :
'options(stringsAsFactors = TRUE)' is deprecated and will be
disabled Error in setwd("C:/R/WorkingDir") : cannot change working
directory Execution halted Warning in install.packages :
installation of package ‘tidyselect’ had non-zero exit status
I also had this error when I first loaded R up that seems to be reappearing due any attempt to install packages:
Error in setwd("C:/R/WorkingDir") :
cannot change working directory
I've never had this issue before using RStudio across numerous machines and software versions, can anyone advise what is going on? My name (and thus C:\ user file path(s)) does have an apostrophe in it, if that matters - but it has never been an issue before. Is some key installation setting now misaligned and if yes, can anyone advise how to resolve?

Cannot install tsDyn package in RStudio, 'mnormt' doesn't exist

I am trying to install the tsDyn package on my Macbook Pro running MacOSX Catalina version 10.15.2. in RStudio (v.1.3.959), running R (v.4.0.1). I get the following error:
ERROR: compilation failed for package ‘mnormt’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mnormt’
Warning in install.packages :
installation of package ‘mnormt’ had non-zero exit status
I tried installing 'mnormt' myself, as well as deleted all irrelevant packages manually to get rid of any possible older versions that may be interfering with the 'tsDyn' package, but nothing seems to be working.
The 'tsDyn' package seems to be installing otherwise, but I cannot call the function 'VECM' because it R states that it does not exist.
Any help would be much appreciated.
If you are using Anaconda, inside Environments search for "r-mnormt" and install from there. Also you can try inside RStudio:
install.packages("r-mnormt")
It should work now.

Error installing packages in Rstudio

I have R 3.2.2 setup installed in my system,with RStudio version 0.99.489. When I tried to install rJava package,
install.packages("rJava")
I am getting following Error:
Warning in install.packages :
downloaded length 4878 != reported length 200
Error in install.packages : subscript out of bounds
But if I run the below command before installing any package,it works fine, but I don't want to do this every time I install a package.
options(repos=structure(c(CRAN="http://cran.us.r-project.org")))
You can stick the line you want executed at every startup in your .Rprofile file which should be in your home directory. I have 3.2.3 version of R and that worked; however I do get a warning message about using a non-http version of the site.
Similarly to you, I was finding the original repository the system was using was failing to install the packages--not finding the package or downloading a file with too few bytes, perhaps because of a transient problem. You might want to consider not putting this in your .Rprofile file or commenting the line outin case this is a temporary workaround.

ggplot2 version 1.0.1 won't load into R 3.2.2 for Windows

I just started using R and downloaded ggplot2
install.packages("ggplot2")
I get the following warning:
Warning in install.packages:
unable to move temporary installation '\\CHI-FIlE-01\UserFolders$\naresh.kavuri\Documents\R\win-library\3.2\file27ac2d3b613c\ggplot' to '\\CHI-FILE-01\UserFolders$\naresh.kavuri\Documents\R\win-library\3.2\ggplot2'
This warning is followed up with this error:
Error: invalid version specification 'NA'
In addition: warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
As anyone come across this problem before? Did I do something wrong in the setup?
If you have multiple versions of R running, and you try to update or reinstall a package in one version of R while it is loaded in another, then the old version of the package doesn't get completely removed.
Try closing down all instances of R, manually deleting the folder containing the package, then opening a single version of R and reinstalling.
As Pascal commented, antivirus file scans can also interfere with the installation process. Sometimes downloading the package zip/tar.gz file then installing from disk can circumvent the issue.

Error message from install.packages() - wayward continuation line

With RStudio and running under Windows, my effort to install the textreg package encountered a strange error:
> install.packages("textreg")
Warning in install.packages :
downloaded length 17116 != reported length 200
Warning in install.packages :
downloaded length 17116 != reported length 200
Error in install.packages : Found continuation line starting ' <title>Marriott – ...' at begin of record.
Does the error tell me that something in the package has the gremlin ....? Can I fix that problem at my end or should I write Luke Miratrix, the maintainer? Or am I doing something foolish?
Thank you
The windows binary is currently not available from CRAN and that install.packages didn't report that indicates that the mirror is not up-to-date. However, I was able to build the package from source on my Win7 system. Thus, you can use install.packages("textreg", type="source").
The windows binary is currently not available from CRAN because the package failed the windows test suite (for reasons as yet unknown). I am working on fixing that error and apologize for any inconvenience. That being said, installing as mentioned above via
install.packages("textreg", type="source")
will give you a working package. If you get it to crash, please contact me (the maintainer) with details.
Also note that a further mild issue is the static vignette "bathtub" does not show up on CRAN, but is in the inst/doc directory of the package. You can also test the package with the testthat package using the inst/test/testthat folder in the package.

Resources