Display all Functions in an R Package

Roel M. Hogervorst

2020/06/01

Something I keep forgetting: How do you display all the user facing functions from a package?

On stackoverflow I found the following answers:

This function displays all the functions and their arguments

# needs to be active, using library(packagename)
lsf.str("package:pinboardr")

result:

pb_add_tag_column : function (dataframe, tag)  
pb_get_note : function (id = NULL, username = NULL, token = NULL)  
pb_get_notes_overview : function (username = NULL, token = NULL)  
pb_last_update : function (as_datetime = FALSE, username = NULL, token = NULL)  
pb_posts_add : function (url, title, description = NULL, tags = NULL, dt = NULL, replace = NULL, public = NULL, 
    toread = NULL, username = NULL, token = NULL)  

Best option I think is getNamespaceExports()

getNamespaceExports("pinboardr")

which results in function names.

 [1] "pb_add_tag_column"     "pb_get_note"           "pb_get_notes_overview" "pb_last_update"       
 [5] "pb_posts_add"          "pb_posts_all"          "pb_posts_dates"        "pb_posts_delete"