R studio install package failed

Viewed 30

I tried to install the packages in the following way:

pacman::p_load(tidyverse, lubridate, zoo, 
               timetk, modeltime, 
               trelliscopejs, seasonal,
               tsibble, feasts, fable)

However, I got the below errors: enter image description here enter image description here

I'm not sure what's wrong, I'm using the latest R version 4.2.1, the warning seems to suggest that need to change to 4.1.3, is there anyway to install those packages without changing the version?

1 Answers

The problem is not related to the package in itself. The warning about the version only tells you that the last time this package was built was on R 4.1.3, but it should work on R 4.2.

The problem is that the place where R searches this package doesn't exist. If you go here: https://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/, you will see that the last version of R is 3.4, whereas you're looking for a package built in R 4.1 (see the version in the URL address in the error message).

Here's some advice to solve this (I can't reproduce your problem so I can't be sure this works): if you're using RStudio, go to "Tools -> Global Options -> Packages". I think that under "Primary CRAN repository", there should be the name of the current place where R searches for the files to install each package. You can change this: either pick "Global (CDN) - RStudio" or any other that is not too far from your location. Then restart R and try reinstalling the packages.

Related