我有一个 csv 文件,其中的数据如下所示:
"Date","Time","Open","High","Low","Close","Up","Down","Sell","Buy","Stop1","Stop2","Stop3","Target1","Target2","Target3"
04/18/2012,1335,1365.25,1366.00,1365.00,1366.00,2855,1153,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
04/18/2012,1340,1366.00,1366.25,1365.50,1366.00,450,607,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
04/18/2012,1345,1366.00,1366.00,1365.75,1365.75,300,263,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
如果我使用此命令读取文件,则会得到一个字符矩阵:
RawData = as.matrix(read.table(PathName,sep=",",header=TRUE))
typeof(RawData)
[1] "character"
最好我能说这是由于日期列。
我需要这是一个数字数组。我在上面使用的 read.table 命令有什么好的替代方法?