I'm looking for a way of reading only a few columns from a csv file into R using shell() or pipe.
I found this thread that explains how to accomplish that on Linux: Quicker way to read single column of CSV file
On Linux this works adding the what argument:
a <-as.data.frame(scan(pipe("cut -f1,2 -d, Main.csv"),
what=list("character","character"),sep= ","))
However this doesn't seem to work on Windows.
When using pipe("cut -f1 -d, Main.csv")
the connection gets opened but it doesn't return anything.
What would be the functions/syntax I need to use in order to make this work on Windows.
Is is possible to accomplish this by using shell()?
Thanks,
Diego