Hi, The unary forms of is() and extends() report that data.frame extends list, oldClass, and vector:
> is(data.frame()) [1] "data.frame" "list" "oldClass" "vector" > extends("data.frame") [1] "data.frame" "list" "oldClass" "vector" However, the binary form of is() disagrees: > is(data.frame(), "list") [1] FALSE > is(data.frame(), "oldClass") [1] FALSE > is(data.frame(), "vector") [1] FALSE while the binary form of extends() agrees: > extends("data.frame", "list") [1] TRUE > extends("data.frame", "oldClass") [1] TRUE > extends("data.frame", "vector") [1] TRUE Who is right? Shouldn't 'is(object, class2)' be equivalent to 'class2 %in% is(object)'? Furthermore, is there any reason why 'is(object, class2)' is not implemented as 'class2 %in% is(object)'? Thanks, H. -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpa...@fredhutch.org Phone: (206) 667-5791 Fax: (206) 667-1319 ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel