isS3method("t") # FALSE - it is an S3 generic
isS3method("t.default") # TRUE
isS3method("t.ts") # TRUE
isS3method("t.test") # FALSE
isS3method("t.data.frame")# TRUE
isS3method("t.lm") # FALSE - not existing
isS3method("t.foo.bar") # FALSE - not existing
stopifnot(
!isS3method("t"), !isS3method("t.test"), !isS3method("qr.coef"), !isS3method("sort.list"),
isS3method("t.default"), isS3method("t.ts"), isS3method("t.data.frame"),
!isS3method("t.lm"), !isS3method("t.foo.bar"))
Run the code above in your browser using DataLab