R freezes when trying to install packages using install.packages - r

R freezes when trying to install packages using install.packages. This happens with all packages. No warning displayed:
install.packages("TSA")
Also tried:
download.file(destfile = "C:\\Users\\XXX\\Downloads\\TSA_1.3.zip",
url = "https://cran.r-project.org/bin/windows/contrib/4.2/TSA_1.3.zip")
I got:
trying URL 'https://cran.r-project.org/bin/windows/contrib/4.2/TSA_1.3.zip'
Details:
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 1.0
year 2021
month 05
day 18
svn rev 80317
language R
version.string R version 4.1.0 (2021-05-18)
nickname Camp Pontanezen
Using the browser, I can download the package install it directly using the link:
install.packages("C:\\Users\\XXX\\Downloads\\TSA_1.3.zip",repos=NULL,type="win.binary")
But I want to download it from IDE. Is it a windows firewall issue?

Related

Emacs and R - Emacs closes when using tk_choose.dir

I'm using R scripts inside Emacs on Windows 10 Enterprise to analyze data. It works well but recently after sending a tk_choose.dir command, emacs closes (but not R ; the script keeps on running after choosing the folder).
If someone can tell me the result of the following command :
library(tcltk)
c_folder <- tk_choose.dir("c:/")
If needed, here is the output of the version command:
version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 1.3
year 2022
month 03
day 10
svn rev 81868
language R
version.string R version 4.1.3 (2022-03-10)
nickname One Push-Up
Thanks in advance for your help,
Newb'R

R studio initialization stuck in an old version

I have installed the most recent version of R just some minutes ago (version 4.04).
But when I open R studio and run version in my console, it appears to be opened still using the 3.6.1 version:
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 6.1
year 2019
month 07
day 05
svn rev 76782
language R
version.string R version 3.6.1 (2019-07-05)
nickname Action of the Toes
How can I open R studio trough the new version of R I just installed?
You just have to uninstall the old versions of R gathered in your computer from the Panel Control and RStudio will initiate with the oldest version of R.

Error installed R library with version 3.6.0 when only version 3.4 is required

I´m trying to install the library ssev: https://cran.r-project.org/web/packages/ssev/index.html
On a machine with R 3.6.0
install.packages("ssev")
And I´m getting the following error:
“unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'”
Warning message:
“package ‘ssev’ is not available (for R version 3.6.0)”
What I do not understand is why I´m getting this error, when the requiered version for this library is 3.4, as shown in CRAN:
The installation does work with a more recent versions of R like 3.6.3, but in the machine I need it I do not have the option to install a newer version.
I'm using R version 3.6.1 and only getting a warning about the using the library. Generally, you can ignore these and it will still work. If it's not, try updating the package and post the results of trying to load the library and also run version to show info on your setup as I did below:
> library(ssev)
Warning messages:
1: In recycle.data(data, FALSE, length(x), units) :
reached elapsed time limit
2: package ‘ssev’ was built under R version 3.6.3
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 6.1
year 2019
month 07
day 05
svn rev 76782
language R
version.string R version 3.6.1 (2019-07-05)
nickname Action of the Toes

Change R Installation Directory in RStudio

I am on R-3.3.0 and set up RStudio. This is the output I get when I try to find the version in RStudio
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 3.0
year 2016
month 05
day 03
svn rev 70573
language R
version.string R version 3.3.0 (2016-05-03)
nickname Supposedly Educational
I want to change it to point to the R-2.5.1 instance I have installed in my machine. How do I go about this?

Definitely install a package in Rstudio

I have to reinstall all the packages like dplyror ggplot2 each time that I restart Rstudio.
Do you have any suggestion for setting once and for all my packages in Rstudio?
> version
Blockquote _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 2.2
year 2015
month 08
day 14
svn rev 69053
language R
version.string R version 3.2.2 (2015-08-14)
nickname Fire Safety
Blockquote
You could either have a script that runs:
packages <- c("plyr", "ftnonpar")
install.packages(packages)
Where you would just add entries for each package in packages, and run the script each time you open.
However, it might just be that you are not calling the packages each time you restart Rstudio and need to use:
library(<package_name>)
For each package you intend to use at the top of your script.

Resources