Hi, Loading the "methods" package into R seems to change the class of a character vector from NULL to "character":
> class("abcd") NULL > library("methods") > class("abcd") [1] "character" This can lead to problems. For example the "as.string" function in the "xtable" package assumes that the class of a character vector is NULL. However this changes when the methods package is loaded. Here is a code snippet of the as.string function in the xtable package: > library(xtable) > as.string function (x, file = "", append = FALSE) { if (is.null(class(x))) switch(data.class(x), character = return(string(x, file, append)), numeric = return(string(as.character(x), file, append)), stop("Cannot coerse argument to a string")) if (class(x) == "string") return(x) stop("Cannot coerse argument to a string") } Why does the methods package change the class of character vectors? Is there a way around this behavior? Thanks, PK ______________________________________________ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help