I have a file which looks like this:
Time,Open,High,Low,Close,Volume
01.02.1995 00:00:00.000,1.57920,1.58400,1.57700,1.58240,0.00
02.02.1995 00:00:00.000,1.58200,1.58620,1.57820,1.58130,0.00
03.02.1995 00:00:00.000,1.58150,1.58280,1.56050,1.56180,0.00
04.02.1995 00:00:00.000,1.56180,1.56180,1.56180,1.56180,0.00
I want a dataframe
where the first column is character (changing it to a date is the next step) and the rest numeric, and so I am doing this:
myData <- read.table("C:\\Users\\Adam\\Desktop\\GU95.csv", colClasses=c("character",rep("numeric",5)), header=TRUE, sep = ','))
To check the class of the second column (Open), I am doing this:
myData$Open <- apply(myData, 1, function(row) print(class(row[2])))
However, the output is "character" and not "numeric".
What have i done wrong?