mercredi 1 avril 2015

How do I convert a deliminated file in base - R into seperate columns without creating a list?

I currently do this using the following code

write(unlist(fieldList),"c:/temp/test.txt") temp1<-cbind(fieldList,read.delim("c:/temp/test.txt",sep=" ",header=FALSE))


but this is slow because it obliges the app to write data to temp file on disk.


I have tried strsplit function and "qdap" library but they both create lists. I need to be able to manipulate the columns separately


NewColumn <- substr(temp1[,5],1,1)


Aucun commentaire:

Enregistrer un commentaire