I’d like to pass argument (stringsAsFactors=FALSE) to rbind in do.call. But the following doesn’t work:
data <- do.call(rbind,
strsplit(readLines("/home/jianfezhang/adoption.txt"), split="\t#\t"),
args=list(stringsAsFactors=FALSE))
would have been my answer, if it wasn’t for the fact that
rbinddoes not know what to do withstringsAsFactors(butcbind.data.framewould).The output of
strsplitis presumably a list of vectors, in which caserbindcreates a matrix. You can specifystringsAsFactorswhen converting this matrix to a data.frame,