2

I was wondering if there might be a way to find all Base R function names that contain the string "list"?

rnorouzian
  • 7,397
  • 5
  • 27
  • 72

2 Answers2

7

lsf.str returns all the functions in a particular package, you can then use grep with the keyword and return all the names of the functions which match it.

grep("list", lsf.str("package:base"), value = TRUE)

# [1] "[.Dlist"                 "[.listof"                "[.simple.list"          
# [4] "alist"                   "all.equal.list"          "as.data.frame.list"     
# [7] "as.list"                 "as.list.data.frame"      "as.list.Date"           
#[10] "as.list.default"         "as.list.environment"     "as.list.factor"         
#[13] "as.list.function"        "as.list.numeric_version" "as.list.POSIXct"        
#[16] "as.list.POSIXlt"         "as.pairlist"             "iconvlist"              
#[19] "is.list"                 "is.pairlist"             "list"                   
#[22] "list.dirs"               "list.files"              "list2env"               
#[25] "pairlist"                "print.Dlist"             "print.listof"           
#[28] "print.simple.list"       "sort.list"               "unlist"                 
#[31] "within.list"            
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
4

objects is the sibling function of ls (List Objects).

objects("package:base", pattern ="list")

Use apropos and find for finding objects in the whole search path.

M.Viking
  • 5,067
  • 4
  • 17
  • 33