Dictionary function error

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I create one? Using a reprex, complete with representative data will attract quicker and more answers. Screenshots are seldom helpful.

Fortunately , the error message gives enough to go on

"Dictionary" function could not be found

says it simply.

Dictionary is being used as a function

sms_dict <- Dictionary(findFreqTerms(sms_dtm_train, 5))

Some functions are always available, like


Some are available only when they are defined by the user

#> Loading required package: clipr
#> Welcome to clipr. See ?write_clip for advisories on writing to the clipboard in R.
#> Loading required package: magrittr
#> Loading required package: stringr

specimen <- function(x)
  deparse(x) %>%
  str_c(collapse = '') %>%
  str_replace_all('\\s+', ' ') %>%
  str_replace_all('\\s*([^,\\()]+ =) (c\\()', '\n  \\1\n    \\2')  %>%
  str_replace_all('(,) (class =)', '\\1\n  \\2') %>%
  write_clip(allow_non_interactive = TRUE)

Functions are case sensitive. In the example above, specimen works, but Specimen will not.

Most functions come from optional libraries. Those first have to be installed

install.packages("dplyr") # only has to be done once



will make all the many functions in that library immediately available.

If you don't know which package that the function comes from, it' often easy to find them using rseek site that searches Google with special syntax to bring R resources to the top.

That is easy with unusual names, such as GetBatchSymbols, but it is not easy finding the right Dictionary