Help with Error in doc_namespaces(doc) : external pointer is not valid

I am suddenly getting the above error when starting RStudio. I have tried googling but found nothing of help. I am very inexperienced in both R and RStudio use, but did think to start R on its own not through RStudio and the error message does not appear so I am assuming this is somehow related to RStudio. Below is what prints to the console when starting RStudio before loading any packages or running any code. Thank you in advance for any help you can offer to a newbie.

R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Error in doc_namespaces(doc) : external pointer is not valid

Do you have this options enabled in RStudio, if so, disabling this (or deleting your .RData file) makes any difference for you?

Do you have modified your file?

Thanks for response, andresrcs.
I do not have that option enabled in RStudio, and I haven't modified my file.

As Andrés suggests, such errors usually appear mysteriously on launch when data from a previous session is restored, but the associated resources aren't available or packages loaded. Imagine, you have a Word Document pointer in memory, but the associated library hasn't yet been loaded in the current session or the associated file has since been deleted.

Data can be restored because the previous environment was saved and is automatically being reloaded (check your environment pane to be sure it's empty on launch) or because you've left data Viewer tabs open.

1 Like

Thank you WilDoan for your explanation, which led to the resolution of the problem. Following your advice I tried:

ensuring the environment was empty on launch - it was.
clearing the history and relaunching RStudio - no change
closing data Viewer tabs that had been left open and relaunching RStudio - no change
closing all open R scripts and relaunching RStudio - error message disappeared.

I assume something in one of my R scripts is pointing somewhere that isn't available on launch. I'll reload the scripts one by one to see if I can better understand which is causing the problem.

Thanks again to you and andresrcs for your helpful suggestions.

1 Like

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