I have an excel file, and I want to read a column (i.e first 128 values of third column) line by line and save it in a list. I have written this code to read each line and extract the values but it doesn't work properly:
con<-file("D:\\MA\\excel_mix_meiningen.xls","r")
datalist<-list()
m<-list()
# which column
spalte<-3
#How many values?
for(i in 1:128)
{
line<-readLines(con,n=1,warn=FALSE)
datalist<-c(datalist,sapply(line,"[[",spalte))
}
close(con)
datalist
I am seeing this error:
Error in FUN("ÐÏ\021ࡱ"[[1L]], ...) : subscript out of bounds
I know, there is some package to do this job, but I want to use this methode ;)