I've thrown together a bunch of my utility functions into a package. However, I can't seem to access them after I've installed the package. I get errors of the form Error: object 'function_name' not found
Any thoughts?
Do you use a NAMESPACE and forgot to add the object in question?
If you're using roxygen2, have you remembered to add #' @export function_name
to the functions you want included in the namespace?
If the function name is not exported, you may need to use ":::"
pkgname:::function_name
I believe that CRAN now requires a NAMESPACE, and I think R 2.14.x may even require them.
The same problem for me, you need to change NAMESPACE file. sometime NAMESPACE's content looks like this:
# Generated by roxygen2: do not edit by hand
But you need to change it by hand , like this:
# Generated by roxygen2: do not edit by hand
export("function_name1", "function_name2")
OR use exportPattern("^[^\\\\.]")
to export all function.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.