I am using the Sparklines package in R and was using the reshapeExt() function to prepare a dataset, but ran into a very very strange issue. The dataset looks like this:
Company time value
1 Microsoft 1990 11
2 Time Warner 1990 22
3 Verizon 1990 33
4 Microsoft 1991 44
5 Time Warner 1991 55
6 Verizon 1991 66
7 Microsoft 1992 77
8 Time Warner 1992 88
9 Verizon 1992 99
And then I followed the tutorial example to run these lines:
example <- example[,c("Company","value","time")]
example$time <- as.numeric ( as.character ( example$ time ))
dat <- reshapeExt ( example , idvar =" Company " , varying = list (2))
Inexplicably, R gave me this for "dat":
Company time value Company
1 Microsoft 1 11 1
2 Time Warner 1 22 2
3 Verizon 1 33 3
4 Microsoft 1 44 4
5 Time Warner 1 55 5
6 Verizon 1 66 6
7 Microsoft 1 77 7
8 Time Warner 1 88 8
9 Verizon 1 99 9
The time column all became 1 for no apparent reason. This does not happen when I was implementing the example at https://web.warwick.ac.uk/statsdept/user2011/TalkSlides/Contributed/18Aug_0950_FocusVI_4-ReportingData_2-Kowarik.pdf page 18 - what's happening here?
Any help is appreciated