[R] Format Data Issue??

2010-09-15 Thread Randy Cass
R Users, I am new to R and have tried to figure out how to automate this process instead of using excel. I have read in this dataframe into r with read.table. I need to reshape the data from the first table into the format of the second table. TractID StandID Species CruiseDate DBHClass

[R] find most repeated item from column in dataframe

2010-08-24 Thread Randy Cass
R users, I am trying to find some way to find the value of a column that is repeated the most for each StandID of a dataframe. I have research methods online and the help page, but have had no success in finding a solution. I have tried using the table function but it returns items for the whole

[R] help with code

2010-04-26 Thread Randy Cass
. print(mydata) # Applies basic math to the group selected by the logic. mydata$score1[gals]<- 2*q1[gals] + q2[gals] mydata$score2[gals]<- 3*q1[gals] + q2[gals] mydata$score1[guys]<-20*q1[guys] + q2[guys] mydata$score2[guys]<-30*q1[guys] + q2[guys] print(mydata)

[R] Help with replacement of certain values in dataset with SAS code equivalent

2010-04-26 Thread Randy Cass
ot;NAH6005-001" #Creates a logical vector for males. StandFTI$score1[Stand]<- "TEST" print(StandFTI) But I get the warning message: In `[<-.factor`(`*tmp*`, guys, value = "TEST") : invalid factor level, NAs generated Any help will be greatly appreciated!