Rstudio cannot find packages now, but could before I had to reconnect to my Microsoft licenses.

Error Information:

I cannot load packages that I had previously installed and loaded successfully. This occurred after I had to reestablish my Microsoft license after my daughter shut down my laptop in an unusual way.

Steps taken so far -
checked .libPath to see if it was pointing to the right directory on my laptop and it was.

.libPaths()
[1] "C:/Users/mikep/Documents/R/win-library/4.0"
[2] "C:/Program Files/R/R-4.0.5/library"
library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in get(Info[i, 1], envir = env):
cannot open file 'C:/Users/mikep/Documents/R/win-library/4.0/colorspace/R/colorspace.rdb': No such file or directory
Tried installing glue and restarting R, but that did not work .

My next step would be to reinstall Rstudio and hopefully restablish the links which seem to have been disrupted, but I would like to know if there is another, better option before doing so.

I deleted most of the error log to stay within space limits, but it seems that my machine is blocking a path that used to be open to RStudio.

System Information:

2022.07.1 Build 554

  • RStudio Version:
  • OS Version:
  • R Version: R 4.05

Also:

  • RStudio diagnostics report:
  • Your sessionInfo():
  • RStudio crash report:
  • RStudio application log files:

RStudio Diagnostics Report

WARNING: This report may contain sensitive security information and / or
personally identifiable information. Please audit the below and redact any
sensitive information before submitting your diagnostics report.

Generated: Fri Aug 05 07:41:48 2022

RStudio Version

2022.07.1+554

Session Information

R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_4.0.5 R6_2.4.1 cli_3.3.0 tools_4.0.5
[5] gtable_0.3.0 rstudioapi_0.13 grid_4.0.5 lifecycle_1.0.1
[9] rlang_1.0.4

Environment Variables

ALLUSERSPROFILE : C:\ProgramData
APPDATA : C:\Users\mikep\AppData\Roaming
CLICOLOR_FORCE : 1
CommonProgramFiles : C:\Program Files\Common Files
CommonProgramFiles(x86) : C:\Program Files (x86)\Common Files
CommonProgramW6432 : C:\Program Files\Common Files
COMPUTERNAME : DESKTOP-5MCGUFH
ComSpec : C:\Windows\system32\cmd.exe
DISPLAY : :0
DriverData : C:\Windows\System32\Drivers\DriverData
GFORTRAN_STDERR_UNIT : -1
GFORTRAN_STDOUT_UNIT : -1
HOME : C:/Users/mikep/Documents
HOMEDRIVE : C:
HOMEPATH : \Users\mikep
LOCALAPPDATA : C:\Users\mikep\AppData\Local
LOGONSERVER : \DESKTOP-5MCGUFH
MPLENGINE : tkAgg
MSYS2_ENV_CONV_EXCL : R_ARCH
NUMBER_OF_PROCESSORS : 12
OneDrive : C:\Users\mikep\OneDrive
OneDriveConsumer : C:\Users\mikep\OneDrive
OS : Windows_NT
PATH : C:\RBuildTools\4.0\usr\bin;C:\Program Files\R\R-4.0.5\bin\x64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Users\mikep\AppData\Local\Microsoft\WindowsApps;;C:/Program Files/RStudio/bin/quarto/bin
PATHEXT : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE : AMD64
PROCESSOR_IDENTIFIER : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
PROCESSOR_LEVEL : 6
PROCESSOR_REVISION : 9e0a
ProgramData : C:\ProgramData
ProgramFiles : C:\Program Files
ProgramFiles(x86) : C:\Program Files (x86)
ProgramW6432 : C:\Program Files
PSModulePath : C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC : C:\Users\Public
PYTHONIOENCODING : utf-8
QT_D3DCREATE_MULTITHREADED : 1
R_ARCH : /x64
R_CLI_HAS_HYPERLINK_IDE_HELP : true
R_CLI_HAS_HYPERLINK_IDE_RUN : true
R_CLI_HAS_HYPERLINK_IDE_VIGNETTE : true
R_COMPILED_BY : gcc 8.3.0
R_DOC_DIR : C:/PROGRA~1/R/R-40~1.5/doc
R_HOME : C:/PROGRA~1/R/R-40~1.5
R_LIBS_USER : C:/Users/mikep/Documents/R/win-library/4.0
R_USER : C:/Users/mikep/Documents
RMARKDOWN_MATHJAX_PATH : C:/Program Files/RStudio/resources/mathjax-27
RS_LOCAL_PEER : \.\pipe\61672-rsession
RS_RPOSTBACK_PATH : C:/Program Files/RStudio/bin/rpostback
RS_SHARED_SECRET : *** redacted ***
RSTUDIO : 1
RSTUDIO_CLI_HYPERLINKS : true
RSTUDIO_CONSOLE_COLOR : 256
RSTUDIO_CONSOLE_WIDTH : 80
RSTUDIO_MSYS_SSH : C:/Program Files/RStudio/bin/msys-ssh-1000-18
RSTUDIO_PANDOC : C:/Program Files/RStudio/bin/quarto/bin/tools
RSTUDIO_PROGRAM_MODE : desktop
RSTUDIO_SESSION_PID : 15000
RSTUDIO_SESSION_PORT : 61672
RSTUDIO_USER_IDENTITY : mikep
RSTUDIO_WINUTILS : C:/Program Files/RStudio/bin/winutils
RTOOLS40_HOME : C:\RBuildTools\4.0
SESSIONNAME : Console
SystemDrive : C:
SystemRoot : C:\Windows
TEMP : C:\Users\mikep\AppData\Local\Temp
TERM : xterm-256color
TMP : C:\Users\mikep\AppData\Local\Temp
USERDOMAIN : DESKTOP-5MCGUFH
USERDOMAIN_ROAMINGPROFILE : DESKTOP-5MCGUFH
USERNAME : *** redacted ***
USERPROFILE : C:\Users\mikep
windir : C:\Windows
ZES_ENABLE_SYSMAN : 1

R Version

platform : x86_64-w64-mingw32
arch : x86_64
os : mingw32
system : x86_64, mingw32
status :
major : 4
minor : 0.5
year : 2021
month : 03
day : 31
svn rev : 80133
language : R
version.string : R version 4.0.5 (2021-03-31)
nickname : Shake and Throw

R Home

C:/PROGRA~1/R/R-40~1.5

R Search Path

.GlobalEnv
tools:rstudio
package:stats
package:graphics
package:grDevices
package:utils
package:datasets
package:methods
Autoloads
org:r-lib
package:base

R Library Paths

C:/Users/mikep/Documents/R/win-library/4.0
C:/Program Files/R/R-4.0.5/library

R System Profile: C:/PROGRA~1/R/R-40~1.5/library/base/R/Rprofile

This is the system Rprofile file. It is always run on startup.

Additional commands can be placed in site or user Rprofile files

(see ?Rprofile).

Copyright (C) 1995-2020 The R Core Team

Notice that it is a bad idea to use this file as a template for

personal startup files, since things will be executed twice and in

the wrong environment (user profiles are run in .GlobalEnv).

.GlobalEnv <- globalenv()
attach(NULL, name = "Autoloads")
.AutoloadEnv <- as.environment(2)
assign(".Autoloaded", NULL, envir = .AutoloadEnv)
T <- TRUE
F <- FALSE
R.version <- structure(R.Version(), class = "simple.list")
version <- R.version # for S compatibility

for backwards compatibility only

R.version.string <- R.version$version.string

NOTA BENE: options() for non-base package functionality are in places like

--------- ../utils/R/zzz.R

options(keep.source = interactive())
options(warn = 0)

options(repos = c(CRAN="@CRAN@"))

options(BIOC = "http://www.bioconductor.org")

setting from an env variable added in 4.0.2

local({to <- as.integer(Sys.getenv("R_DEFAULT_INTERNET_TIMEOUT", 60))
if (is.na(to) || to <= 0) to <- 60L
options(timeout = to)
})
options(encoding = "native.enc")
options(show.error.messages = TRUE)

keep in sync with PrintDefaults() in ../../main/print.c :

options(scipen = 0)
options(max.print = 99999)# max. #{entries} in internal printMatrix()
options(add.smooth = TRUE)# currently only used in 'plot.lm'

if(isFALSE(as.logical(Sys.getenv("R_OPTIONS_STRINGS_AS_FACTORS",
"FALSE")))) {
options(stringsAsFactors = FALSE)
} else {
options(stringsAsFactors = TRUE)
}

if(!interactive() && is.null(getOption("showErrorCalls")))
options(showErrorCalls = TRUE)

local({dp <- Sys.getenv("R_DEFAULT_PACKAGES")
if(identical(dp, "")) ## it fact methods is done first
dp <- c("datasets", "utils", "grDevices", "graphics",
"stats", "methods")
else if(identical(dp, "NULL")) dp <- character(0)
else dp <- strsplit(dp, ",")[[1]]
dp <- sub("[[:blank:]]*([[:alnum:]]+)", "\1", dp) # strip whitespace
options(defaultPackages = dp)
})

Expand R_LIBS_* environment variables.

Sys.setenv(R_LIBS_SITE =
.expand_R_libs_env_var(Sys.getenv("R_LIBS_SITE")))
Sys.setenv(R_LIBS_USER =
.expand_R_libs_env_var(Sys.getenv("R_LIBS_USER")))

local({
if(nzchar(tl <- Sys.getenv("R_SESSION_TIME_LIMIT_CPU")))
setSessionTimeLimit(cpu = tl)
if(nzchar(tl <- Sys.getenv("R_SESSION_TIME_LIMIT_ELAPSED")))
setSessionTimeLimit(elapsed = tl)
})

.First.sys <- function()
{
for(pkg in getOption("defaultPackages")) {
res <- require(pkg, quietly = TRUE, warn.conflicts = FALSE,
character.only = TRUE)
if(!res)
warning(gettextf('package %s in options("defaultPackages") was not found', sQuote(pkg)),
call. = FALSE, domain = NA)
}
}

called at C level in the startup process prior to .First.sys

.OptRequireMethods <- function()
{
pkg <- "methods" # done this way to avoid R CMD check warning
if(pkg %in% getOption("defaultPackages"))
if(!require(pkg, quietly = TRUE, warn.conflicts = FALSE,
character.only = TRUE))
warning('package "methods" in options("defaultPackages") was not found',
call. = FALSE)
}

if(nzchar(Sys.getenv("R_BATCH"))) {
.Last.sys <- function()
{
cat("> proc.time()\n")
print(proc.time())
}
## avoid passing on to spawned R processes
## A system has been reported without Sys.unsetenv, so try this
try(Sys.setenv(R_BATCH=""))
}

local({
if(nzchar(rv <- Sys.getenv("R_RNG_VERSION")))
suppressWarnings(RNGversion(rv))
})
###-- R --

this will break if R is on a network share

.Library <- file.path(chartr("\", "/", R.home()), "library")
.Library.site <- Sys.getenv("R_LIBS_SITE")
.Library.site <- if(!nchar(.Library.site)) file.path(R.home(), "site-library") else unlist(strsplit(.Library.site, ";"))
.Library.site <- .Library.site[file.exists(.Library.site)]

if(!nzchar(Sys.getenv("R_LIBS_USER")))
Sys.setenv(R_LIBS_USER=
file.path(Sys.getenv("R_USER"), "R",
"win-library",
paste(R.version$major,
sub("\..*$", "", R.version$minor),
sep=".")
))

invisible(.libPaths(c(unlist(strsplit(Sys.getenv("R_LIBS"), ";")),
unlist(strsplit(Sys.getenv("R_LIBS_USER"), ";"))
)))

local({
popath <- Sys.getenv("R_TRANSLATIONS", "")
if(!nzchar(popath)) {
paths <- file.path(.libPaths(), "translations", "DESCRIPTION")
popath <- dirname(paths[file.exists(paths)][1])
}
bindtextdomain("R", popath)
bindtextdomain("R-base", popath)
bindtextdomain("RGui", popath)
assign(".popath", popath, .BaseNamespaceEnv)
})

if(nzchar(Sys.getenv("R_PAPERSIZE"))) {
options(papersize = Sys.getenv("R_PAPERSIZE"))
} else {
if(grepl("(canada|united.states)", Sys.getlocale("LC_MONETARY"),
ignore.case = TRUE)) options(papersize = "letter")
else options(papersize = "a4")
}

options(pager = if(length(grep("--ess", commandArgs()))) "console" else "internal",
useFancyQuotes = (.Platform$GUI == "Rgui"),
pdfviewer = Sys.getenv("R_PDFVIEWER", file.path(R.home("bin"), "open.exe")))

if(.Platform$GUI == "Rgui")
Sys.setenv(GFORTRAN_STDOUT_UNIT = "-1", GFORTRAN_STDERR_UNIT = "-1")

local({
br <- Sys.getenv("R_BROWSER", NA_character_)
if(!is.na(br)) options(browser = br)
tests_startup <- Sys.getenv("R_TESTS")
if(nzchar(tests_startup)) source(tests_startup)
ca_cert <- Sys.getenv("CURL_CA_BUNDLE", NA_character_)
if(!is.na(ca_cert) &&
file.exists(ca_path <- file.path(R.home("etc"), "curl-ca-bundle.crt")))
Sys.setenv(CURL_CA_BUNDLE = ca_path)
})

R User Profile: C:/Users/mikep/Documents/.Rprofile

(File does not exist)

R Site Environ: C:/PROGRA~1/R/R-40~1.5/etc/Renviron.site

(File does not exist)

R User Environ: C:/Users/mikep/Documents/.Renviron

PATH="{RTOOLS40_HOME}\usr\bin;{PATH}"

R Temporary Directory

C:\Users\mikep\AppData\Local\Temp\Rtmpo9HCW5

Files in R Temporary Directory

Rhttpd3a981df71
Rhttpd3a9834e674fa
Rhttpd3a986be154e3
rs-graphics-497ad9d3-d9da-4a44-b6ae-e8904e1ba8f2

Log file: C:/Users/mikep/AppData/Local/RStudio/log/rdesktop.log

(Not Found)

Log file: C:/Users/mikep/AppData/Local/RStudio/log/rsession-mikep.log

2022-08-05T11:37:00.077555Z [rsession-mikep] ERROR system error 10053 (An established connection was aborted by the software in your host machine) [request-uri: /help/doc/home/]; OCCURRED AT void __cdecl rstudio::session::HttpConnectionImpl::sendResponse(const class rstudio::core::http::Response &) C:\Users\jenkins\workspace\ide\open-source-pipeline\spotted-wakerobin\src\cpp\session\http\SessionHttpConnectionImpl.hpp:156; LOGGED FROM: void __cdecl rstudio::session::HttpConnectionImpl::sendResponse(const class rstudio::core::http::Response &) C:\Users\jenkins\workspace\ide\open-source-pipeline\spotted-wakerobin\src\cpp\session\http\SessionHttpConnectionImpl.hpp:161
2022-08-05T11:37:00.077555Z [rsession-mikep] ERROR system error 10053 (An established connection was aborted by the software in your host machine) [request-uri: /help/doc/home/]; OCCURRED AT void __cdecl rstudio::session::HttpConnectionImpl::sendResponse(const class rstudio::core::http::Response &) C:\Users\jenkins\workspace\ide\open-source-pipeline\spotted-wakerobin\src\cpp\session\http\SessionHttpConnectionImpl.hpp:156; LOGGED FROM: void __cdecl rstudio::session::HttpConnectionImpl::sendResponse(const class rstudio::core::http::Response &) C:\Users\jenkins\workspace\ide\open-source-pipeline\spotted-wakerobin\src\cpp\session\http\SessionHttpConnectionImpl.hpp:161

User prefs: C:/Users/mikep/AppData/Roaming/RStudio/rstudio-prefs.json

{
"default_project_location": "C:/Users/mikep/Annual_Meeting_2022"
}

System prefs: C:/ProgramData/RStudio/rstudio-prefs.json

(Not Found)

User state: C:/Users/mikep/AppData/Local/RStudio/rstudio-desktop.json

{
"context_id": "6F0AD220",
"error_handler_type": "traceback"
}


From Troubleshooting Guide: Using RStudio

It turns out that I had to reinstate my status as an administrator and then RStudio worked as it did before; so, the problem seems to have been solved.