Skip to content
Prev 128057 / 398500 Next

How to format data for time-series analysis

Just add the steps to do the conversion yourself.  Also you data seems
to be missing columns, at least in the mail you sent.  Also the 'zoo'
object will be a character matrix.
+ 24-10-20   BMU          20
+ 25-10-20 Image           2
+ 26-10-20   BMU          10
+ 27-10-20   BMU          11
+ 28-10-20 Image           3
+ 29-10-20  DPMS Begin    NA
+ 30-10-20 Dream Begin    NA
+ 31-10-20   BMU           3
+  1-11-20 Image           4
+  2-11-20   BMU          50
+  3-11-20   BMU          20
+  4-11-20  DPMS   End    NA
+  5-11-20 Dream   End    NA
+ "), fill=TRUE, header=TRUE)
chr [1:13, 1:3] "BMU" "Image" "BMU" "BMU" "Image" "DPMS" "Dream"
"BMU" "Image" ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:13] "1" "2" "3" "4" ...
  ..$ : chr [1:3] "Event" "State" "Value"
 - attr(*, "index")=Class 'Date'  num [1:13] 18559 18560 18561 18562 18563 ...
Event State Value
2020-10-24 BMU   20    <NA>
2020-10-25 Image 2     <NA>
2020-10-26 BMU   10    <NA>
2020-10-27 BMU   11    <NA>
2020-10-28 Image 3     <NA>
2020-10-29 DPMS  Begin <NA>
2020-10-30 Dream Begin <NA>
2020-10-31 BMU   3     <NA>
2020-11-01 Image 4     <NA>
2020-11-02 BMU   50    <NA>
2020-11-03 BMU   20    <NA>
2020-11-04 DPMS  End   <NA>
2020-11-05 Dream End   <NA>

        
On 10/28/07, B. Bogart <bbogart at sfu.ca> wrote: