Thursday 15 August 2013

loading .csv file in R? -



loading .csv file in R? -

i'm loading csv file r quandl database. file comma delimited , info looks follows:

quandl code,name wiki/act,"actavis, inc." wiki/adm,"archer-daniels-midland company" wiki/aee,"ameren corporation" ... ...

i utilize next code load data:

us.stocks <-read.table(file=abc,header=false,sep=",")

however, next error:

error in read.table(data.frame(file = abc, header = false, : 'file' must character string or connection

can pls help me im doing wrong? suspect ive not classified parameter in read.csv command?

thanks tom

you should utilize

read.csv(file = yourfilepath, header = true)

but think problem in file path, maybe missing file extension , remember wrap file path in double qoutes ( "yourfilepath" )

update:

read.csv wrappers around read.table default parameters

function (file, header = true, sep = ",", quote = "\"", dec = ".", fill = true, comment.char = "", ...) { read.table(file = file, header = header, sep = sep, quote = quote, dec = dec, fill = fill, comment.char = comment.char, ...) }

r csv

No comments:

Post a Comment