Re: [R] Conditional Loop For Data Frame Columns

2012-01-08 Thread jawbonemurphy
Hi Dave, Thanks for your response! I'm new at R, and I'm afraid I'm not sure what you mean by: ?lapply ?"[" ?order Were these suggestions for other commands to try? If so, can you be more specific? I apologize for being clueless :) Secondly, you're right that the script I have now leaves me

[R] Conditional Loop For Data Frame Columns

2012-01-08 Thread jawbonemurphy
Hi, I am trying to create a script that will evaluate each column of a data frame, regardless of # columns, using some function and sorting the results by an index vector: #upload data (112 rows x 73 columns) SD <- read.csv("/Users/johnjacob/Desktop/StudentsData_RInput.csv", header=TRUE) #assign

Re: [R] Turning Data Frame Columns into Vectors

2011-10-15 Thread jawbonemurphy
nt on the factors > in column 1. You may want to look at the tapply() function, in particular. > > HTH, > Daniel > > jawbonemurphy wrote: > Hi, > > I converted an Excel file into a .txt file "X.txt" with no header > (X.txt<http://r.789695.n4.nabble.com/fi

[R] Turning Data Frame Columns into Vectors

2011-10-15 Thread jawbonemurphy
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 vect

Re: [R] Length of data.frame column

2011-10-14 Thread jawbonemurphy
Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > ------- > > Sent from my phone. Please excuse my brevity. > > jawbonemurphy <[hidden &g

Re: [R] Length of data.frame column

2011-10-13 Thread jawbonemurphy
I have a related question...I have a data frame similar with 74 rows that I created with "header=TRUE", but when I try to coerce one of the data frame columns into a vector, it shows up as having length 1, even though when I print it, it shows 74 elements: > VAL <- c(DailyDiary[1]) > VAL > [1] 3 3