[R] findAssocs()

Rolf Turner rolf.turner at xtra.co.nz
Tue Sep 27 02:19:29 CEST 2011

On 27/09/11 12:56, Henri-Paul Indiogine wrote:
> I am trying to find the math behind the "tm" package findAssocs()
> ?findAssocs does not say anything besides "association" and "correlate"
> Usually entering "findAssocs" at the CLI gives the code for a R
> function, but in this case I obtain:
> function (x, term, corlimit)
> UseMethod("findAssocs", x)
> <environment: namespace:tm>
> Any ideas?

Yes.  Apparently the findAssocs() function is *generic* and there is
at least one *method* for it.

Type methods(findAssocs) to find the list of all available methods.

Then type the name of a particular method to see the code for
that method.  E.g. if there is a method "findAssocs.melvin" (which
is the method "dispatched" when you invoke


where "x" is an object of class "melvin") then typing


will show the code for this method.

You should probably read up a bit on S3 methods and objects.


will give you a start.



         Rolf Turner

More information about the R-help mailing list