RStudio and caret package installation issue

There is a problem installing "caret" package in RStudio.

My system: macOS BigSur (11.6), Intel chip.

proper RStudio and R packages are loaded.

I tried to install packages with dependencies = TRUE. It fixed initial issue with dplyr. However the issue with "caret" persists.

Here is the error message.

instal.packages("caret", dependencies = TRUE)

tar: Retrying...
tar: gzip decompression failed
tar: Error exit delayed from previous errors.
Warning in install.packages :
'tar' returned non-zero exit code 1

ar: Damaged tar archive
tar: Retrying...
tar: Damaged tar archive
tar: Retrying...
tar: Damaged tar archive
tar: Retrying...
tar: gzip decompression failed
tar: Error exit delayed from previous errors.
Warning in install.packages :
'tar' returned non-zero exit code 1

The downloaded binary packages are in
/var/folders/xr/szwk8gmj3sd16fc8ryx7snbjq37zk9/T//RtmpvtBhfq/downloaded_package

library(caret)

Loading required package: ggplot2
Loading required package: lattice
Error: package or namespace load failed for ‘caret’:
.onLoad failed in loadNamespace() for 'data.table', details:
call: NULL
error: invalid version specification ‘before 1.12.0’

detach("package:caret", unload = TRUE)
Error in detach("package:caret", unload = TRUE) : invalid 'name' argument

Please, help

Thank you

PS. Strangely my other macPro with M1 chip has no problems at all.

indicates a corrupted file download for caret. You might try again with a different repository.

How do I change the source? in RStudio there is no such option that I am aware of.

Just install.packages(...). It selects the source on its own

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.