How can I stop a package from loading on startup in Rstudio

Viewed 5052

I have an Rstudio project that I've been working on. Since I last updated Rstudio to 1.0.143 - Mac OS X 10.6+ (64-bit) the project fails to start up. I think it might be linked to a package that was automatically loading on start-up and for whatever reason has not decided to stop working with R/Rstudio. XLConnect...

I've tried removing .RData, .Rhistory and .Rproj.user from the directory. Only removing .RData worked and Rstudio started up without issues. I don't seem to have any .RProfile files in the directory, my home directory or a site-wide file either.

Right now I can't even open the Rstudio session because it crashes with an error

R encountered a fatal error. The session was terminated.

I can open other Rstudio sessions without a problem.

When I open a separate R session (no R studio) and try to

load('path/to/.RData')

I get the following error message:

* caught segfault * address 0x18, cause 'memory not mapped'

Traceback: 1: dyn.load(file, DLLpath = DLLpath, ...)

2: library.dynam(lib, package, package.lib)

3: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])

4: asNamespace(ns)

5: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), i[[2L]], from = package)

6: loadNamespace(name)

7: doTryCatch(return(expr), name, parentenv, handler)

8: tryCatchOne(expr, names, parentenv, handlers[[1L]])

9: tryCatchList(expr, classes, parentenv, handlers)

10: tryCatch(loadNamespace(name), error = function(e) { warning(gettextf("namespace %s is not available and has been

replaced\nby .GlobalEnv when processing object %s", sQuote(name)[1L], sQuote(where)), domain = NA, call. = >FALSE, immediate. = TRUE) .GlobalEnv})

11: ..getNamespace(c("openxlsx", "4.0.17"), "uwc.sel.book")

12: load("./Dropbox/OxfordTT2017/DNAextraction_26052017/ColWork2017/Fielddata_04052016/.RData")

Possible actions:

1: abort (with core dump, if enabled)

2: normal R exit

3: exit R without saving workspace

4: exit R saving workspace

So I'm looking for a way to stop the Rstudio session from loading the packages on startup (I'm not sure why it does this in the first place as I don't remember setting any kind of RProfile..).

3 Answers

Sharing my solution: In Rstudio, Tools -> Global Option -> General -> uncheck "Restore most recently opened project at startup"

Previously I deleted my .Rprofile, default .Rdata, and unchecked "Restore .RData into workspace at startup" in the Global options. None of these prevented unwanted packages from loading upon starting Rstudio.

I'm now debugging what project might have caused the problem as I wasn't aware a project was being opened.

Not sure if this will have solved your problem, but I found this page trying to debug my problem and no where else did I see to uncheck "Restore most recently opened project at startup".

Related