Gabor Grothendieck <ggrothendi...@gmail.com> writes: > On Wed, Oct 29, 2014 at 9:09 AM, Thorsten Jolitz <tjol...@gmail.com> wrote: >> >> Hi List, >> >> are there ways to get signatures of all functions of a library in a >> format that is easy to process by a programm (list, xml or so)? >> >> The info about function name, return value and arguments (types) is all >> there in the docs, but more in a human readable format embedded in much >> extra information. How to extract it without writing a documentation >> parser or so? I'm pretty sure the functionality exists, but did not find >> it. >> > > In general, R functions do not have argument and return types (and > don't even have to have names) but maybe this would do: Thats ok, I only need to know about it. Makes calling these functions even easier.
> library(lattice) # need this for make.groups > > # load the package of interest > library(zoo) > > DF <- do.call(make.groups, Map(function(x) names(formals(get(x))), > ls("package:zoo"))) > rownames(DF) <- NULL > > giving: > >> head(DF) > data which > 1 x as.Date > 2 ... as.Date > 3 x as.Date.numeric > 4 origin as.Date.numeric > 5 ... as.Date.numeric > 6 x as.Date.ts Thats a nice solution, thanks a lot! -- cheers, Thorsten ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.