[R] how to check a R object's property
bcarvalh at jhsph.edu
Tue Nov 14 21:28:12 CET 2006
but if all you want is to test whether it's a data.frame or not:
On Nov 14, 2006, at 3:07 PM, Weiwei Shi wrote:
> I am writing a generic function and need to check if an arg is a data
> frame or not. I could use
> is.null(dim(x)) to get what i want. But i want to know if there is a
> function which can tell me whether it is a list, a numeric vector, a
> data frame, a factor and so on. Can R do that?
> Weiwei Shi, Ph.D
> Research Scientist
> GeneGO, Inc.
> "Did you always know?"
> "No, I did not. But I believed..."
> ---Matrix III
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help