[R] how to read the text ?

2011-11-17 Thread haohao Tsing
hi,R users: I have such a text num = 3 testco = 12 testno = 1;12;3 infp = test1;test2;test3 How can I read this text by readLines? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

[R] how to read a free text file into individual variables

2011-11-16 Thread haohao Tsing
hi ,I am writing a soft package based on R. But when I try to read a configure file showed as below. How can I read the parameter in this text file. How can I read the parameter into each variable in this file ? configinfo<-scan(file(configfile),ok=TRUE,n=-1) scan seems need every line have same c

[R] how to indice the column in the data.frame

2011-11-15 Thread haohao Tsing
hi R,users Now I read a data from a txt file newdata<-read.table("1.txt") in the 1.txt ,there are several column shown as below 1 3 4 5 2 3 5 6 4 5 6 7 so when I want analysis the second column anadata<-newdata$V2 but my question I can not use some certain variable to indice the column? e.g cmn=2