pkg::name
format. This is good for one time use or interactive running in console. With the package name prefixed, you can search help on name with F1
in RStudio too.library(pkg)
in previous line, also run library(pkg)
in console.install.packages("devtools")
devtools::install_github("dracodoc/namebrowser")
You can assign keyboard shortcut to addins:
Select Browse Addins from the Addin toolbar button.
Click Keyboard Shortcuts in left bottom.
Per suggestions from @daattali :
- table summary is removed to reduce clutter in UI. User can get table summary information in updating name table.
- Load Package
and Insert Package Prefix
button are disable at first, then enabled after some row was selected.
Removed the function of update name table
from addin menu to reduce clutter or accidental click. This function is recommended to always be used in a new R session. See below for detailed usage information.
Two improvements thanks to feedbacks and suggestions of @daattali . Be sure to check his great addin of collection of known RStudio addins!
- The addin require newest version DT
which is only available in github. Now it will be installed automatically by devtools installer.
- The regular expression search no longer take a separate menu item. There is a check box to switch regular expression mode in the dialog.
The name table shipped with package included about 300 packages so you can start to use immediately. You can update it to match your installed packages.
Session - Restart R
or Ctrl+Shift+F10
. namebrowser::update_name_table()
in console to remove packages not installed locally from the name table, add packages not included before.There could be 3 type of errors in scanning packages, most of them can be solved with a new R session. After scanning, it's almost always better to start a new R session before your work.
If too many packages were loaded in scanning, some packages could fail to be loaded because of maximal number of DLLs reached.
The addin have to load a package first to scan names inside, although extra efforts have been made to unload package after scan, there could be still some packages failed to unload because of dependency with other loaded packages. In one scan of several hundreds of packages, the packages failed to unload could exceed the 100 DLL limit, thus some new packages need those DLL cannot be loaded and scanned.
The scanning process will still update the name table with success results, and save the list of packages that fail to load. You can start a new R session (it's a must since the DLL limit has been reached), run namebrowser::update_name_table(tryError = TRUE)
to process these packages specifically. This time more packages would be scanned successfully, rinse and repeat. It took me 3 runs to scan 400 packages.
After several runs, all the packages failed to load because of DLL limit error are scanned, but there could be some packages left because of installation problem.
Sometimes there is this error in updaing name table if many packages were scanned without restarting R session first:
Error in .Call("Crbindlist", l, use.names, fill) :
"Crbindlist" not resolved from current namespace (data.table)
This seemed to be a data.table
bug which can be avoided by restarting a new R session.
However our last scan updated the package name list already, even if the name table was not updated because of the bug. Thus just restarting a new R session and updating name table again will not actually update the table.
In this case you need to start a new R session, run namebrowser::update_name_table(startNew = TRUE)
to build name table from scratch. The help of ?namebrowser::update_name_table
have more details on parameter options.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.