Skip to content
Prev 281074 / 398503 Next

[newbie] read row from file into vector

On 11-12-29 3:51 PM, Tom Roche wrote:
Those are both column oriented, but you can change the result to a 
vector after reading it.

For example,

x <- read.csv("foo.csv", nrow=1)
x <- as.numeric(x[1,])  # convert to numeric vector

If you don't want the first row, use skip=<something> in the read.csv 
call.

Duncan Murdoch