'R warning: " 'package:stats' may not be available when loading"
I've been working with the arules package and RODBC package for a few days now in RStudio. I saved the workspace image multiple times in the meantime. But today I wanted to save my workspace image again and now I get this warning:
Warning message: In save(list = ls(envir = .GlobalEnv, all.names = TRUE), file = outfile, : 'package:stats' may not be available when loading
I only used arules and RODBC functions and str_split_fixed from stringr and some standard stuff like data.frame.
I didn't even use the stats package at all. When reloading the workspace image, it doesn't seem affected by it. But the warning is bothering me anyway, especially since stats is supposed to be a standard package of R, how can it be unavailable... How can I resolve this warning?
Solution 1:[1]
As the commentator didn't post his comment as an answer, I will close this question myself: it's a bug in RStudio and knowing this thanks to SO I could close down RStudio and a couple R programming sessions later the warning message did not occur again.
Solution 2:[2]
This is now an official rstudio bug.
In my case (the repro in the bug) the root cause was that one of the objects I was trying to save referenced an rstudio-internal function (this isn’t very exotic. A plain options call returns a list that does that). RStudio functions live in tools:rstudio namespace, which inherits the stats package among others - hence the warning.
It is currently planned to be fixed as part of v1.4.
Solution 3:[3]
I'm still getting this warning, I'm on:
RStudio 2022.02.0+443 "Prairie Trillium" Release (9f7969398b90468440a501cf065295d9050bb776, 2022-02-16) for macOS Mozilla/5.0 (Macintosh; Intel Mac OS X 11_6_1) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kim |
| Solution 2 | Ofek Shilon |
| Solution 3 | Laserhedvig |
