Saturday 15 June 2013

Error: could not find function ... in R -


I am using R and tried some.function but I got this error message :

  Error: The function `some.function` could not be found   

This question comes very regularly. When you get a error: the task can not be found in R , how can you solve it?

Thank you in advance for your help.

This is a question of a frequently asked question, so please be possible as possible. Answer is the answer of a community, so if you think something is missing, then do not hesitate to edit.

This question is approved on the meta:

There are some things that you should check:

  1. Have you written the name of your function correctly? Names are case-sensitive.
  2. Have you installed the package that contains the function? install.packages ("thePackage") (This should only be done once)
  3. Have you added that package to the workspace? is required (package) or library (package) (this should be done every time you start a new R session)

    If you are not sure which package the function is located in, you can do a few things.

    1. If you are sure that you have installed and attached / loaded the correct package, then type code to get an info box ("some.function") or ?? some. Find the function, which can tell you what this package is about.
    2. If you do not have any clue about the package, you can use findFn and GetAnywhere
    3. RSiteSearch ("some.function") or in the sos package according to the search with alternative ways of finding the function.

No comments:

Post a Comment