Hi, I converted an Excel file into a .txt file "X.txt" with no header ( http://r.789695.n4.nabble.com/file/n3908157/X.txt X.txt ) and imported it with:
X <- read.table("/Users/johnlogandurland/Desktop/X.txt", header=FALSE). What I would like to do is to make the first column into a factors vector, and then analyze the rest of the columns in the data table using those factors. The problem is, I haven't found a way to convert the rest of the columns into vectors with length = nrows so I can apply the factors vector to them. When I try: vect <- X[1] I get an object with class "data.frame" and length 1, and the "[[]]" command seems to turn the column into a "factor" vector, though with the right length. This seems like it should be a really easy thing to do, but I've looked through R-intro and been unable to find a good answer. Any ideas? Many Thanks, Logan -- View this message in context: http://r.789695.n4.nabble.com/Turning-Data-Frame-Columns-into-Vectors-tp3908157p3908157.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.