[R] Discovering methods

Thomas Lumley tlumley at u.washington.edu
Mon Dec 1 21:41:27 CET 2003


On Mon, 1 Dec 2003, Duncan Murdoch wrote:

> But then the obvious guess at what Gabor wants doesn't work:
>
> >> apropos(class(.leap.seconds))
> > [1] ".__C__POSIXt"        "-.POSIXt"            "+.POSIXt"
> > [4] "as.character.POSIXt" "cut.POSIXt"          "diff.POSIXt"
> > [7] "hist.POSIXt"         "julian.POSIXt"       "Math.POSIXt"
> >[10] "months.POSIXt"       "Ops.POSIXt"          "quarters.POSIXt"
> >[13] "round.POSIXt"        "seq.POSIXt"          "str.POSIXt"
> >[16] "trunc.POSIXt"        "weekdays.POSIXt"
> >Warning messages:
> >1: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >2: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >3: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >4: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >5: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >6: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >7: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >8: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >9: the condition has length > 1 and only the first element will be used in: if (is.na(pattern)) {
> >>
>
> What works is this:
>
>  apropos(paste(class(.leap.seconds),'$',sep='',collapse='|'))
>

or
    sapply(class(.leap.seconds), apropos)


	-thomas




More information about the R-help mailing list