0

When trying to convert the first column as date format using colClasses=c("Date","numeric") I keep getting the following error:

Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : 
  scan() expected 'a real', got '2012-01-03'

The first line looks like:

 data[1,]
        Date   Price
1 2012-01-03          85.40
2 2012-01-04          87.41
3 2012-01-05          88.69
4 2012-01-06          87.34

I have read the date as:

data<-read.table("file/data.txt", header=T, quote="\"")

I have searched in the internet, but could not find out what is wrong with my code. Can someone give me a hint how I can solve this?

DatamineR
  • 10,428
  • 3
  • 25
  • 45

0 Answers0