Dear R-friends I have several data files with about 1,900 lines (records) each. I´m using read.table command to read the files. The files looks like LID , TYPE , PLAND D:\Bijou-MC\Simula_P005_H100_R001.txt , Forest , NA D:\Bijou-MC\Simula_P005_H100_R001.txt , Forest , 10.2 D:\Bijou-MC\Simula_P010_H100_R001.txt , Forest , 9.2 --- My first problem is that some command (like hist(data$PLAND)) say that the data isn´t a numeric one. May be because the first PLAND value are NA? When I done read.table command I used something link: data<-read.table (file="xxx.dat", head=T, sep="\,", na.strings="NA"). Another problem is that I need parse the LID column. When I do "print (head(data$LID) I receive the following result (look that the slash was lost on the read): D:Bijou-MCSimula_P005_H100_R001.txt D:Bijou-MCSimula_P005_H100_R001.txt D:Bijou-MCSimula_P010_H100_R001.txt Its ok to me, but now I need create the P, H and R columns into the "data" table as a parse of LID column. When I try use the command "p<-substr(data$LID, 19,3)" I got an error message saying that the variable is not char one. Finally, I´d like drop the LID column and insert the P, H and R into the table. Thanks for your help! Kind regards, miltinho
__________________________________________________ [[alternative HTML version deleted]]
______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html