.csv Excel ファイルに時系列の 2 つの列、「日付」と「ウィジェット」があります。
次を使用してファイルを R にインポートします。
widgets<-read.csv("C:things.csv")
str(things)
'data.frame': 280 obs. of 2 variables:
$ date: Factor w/ 280 levels "2012-09-12","2012-09-13",..: 1 2 3 4 5 6 7 8 9 10 ...
$ widgets : int 5 10 15 20 30 35 40 50 55 60 65 70 75 80 85 90 95 100 ...
factor things$date を xts または時系列形式に変換するにはどうすればよいですか?
たとえば、次の場合:
hist(things)
Error in hist.default(things) : 'x' must be numeric