How can I view all the hidden/internal variables of an R package within an R session?
By hidden/internal variables I mean the sort of variables described in R Packages - External Data which would be stored in the "/pkg/R/sysdata.Rda" file of a package's source code.
My attempts below. None of these are quite right. I feel like I'm missing something. There has to be a straightforward way to do this, right?
Download source
Of course, I can download the package source and
load(file.path("pkg","R","sysdata.Rda"))
But that would involve work outside my session, which doesn't work for me.
Use RStudio's code completion and :::
Within an RStudio R session, I could do
> library(pkg)
> pkg:::
where RStudio auto-suggests what to include after the :::
. Among the suggestions, it shows all internal variables. This is a decent hack. But I'd like something a little cleaner, which doesn't depend on RStudio's auto-suggestions.
Load .rdx
and .rdb
files?
I noticed
pkg/R/sysdata.rdx
pkg/R/sysdata.rdb
in the package binaries. I thought I might be able to read these to display all the internal variables. How to open .rdb file using R has an answer which relies on lazyLoad
. But I wasn't able to get this working. And it seems others weren't either.