Readers,
I have tried to use the zoo package to merge datasets and then use the
coplot function, but the graph is not fully created. Only the panel
data is shown. Command terminal output below, with csv files. What is
the meaning of the warning message? Can anyone help please?
rhelpatconference.jabber.org
r 251
mandriva 2008
Warning messages:
1: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
2: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
3: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
4: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
5: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
6: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
You have no complete rows so how could it plot anything?
If you had some complete rows then this should work:
coplot(z1 ~ z2 | z3, as.data.frame(z4))
Lines1 <- "09:50:00,315.79
09:50:30,325.43
09:51:00,315.53
09:51:30,313.73
09:52:00,316.11
09:52:30,331.65
09:53:00,325.31
09:53:30,334.33
09:54:00,334.54
09:54:30,336.55
09:55:00,339.34
09:55:30,341.93"
Lines2 <-
"09:50:01,404.75
09:50:44,400.74
09:51:27,199.75
09:52:10,400.86
09:52:54,404.81
09:53:41,404.36
09:54:20,406.11
09:55:03,408.85"
Lines3 <-
"09:50:01,166.12
09:50:44,185.42
09:51:27,211.37
09:52:10,221.72
09:52:54,235.02
09:53:41,262.85
09:54:20,306.64
09:55:03,346.3"
library(zoo)
library(chron)
z1 <- read.zoo(textConnection(Lines1), sep = ",", FUN = times)
z2 <- read.zoo(textConnection(Lines2), sep = ",", FUN = times)
z3 <- read.zoo(textConnection(Lines3), sep = ",", FUN = times)
z4 <- merge(z1, z2, z3)
z4
z1 z2 z3
09:50:00 315.79 NA NA
09:50:01 NA 404.75 166.12
09:50:30 325.43 NA NA
09:50:44 NA 400.74 185.42
09:51:00 315.53 NA NA
09:51:27 NA 199.75 211.37
09:51:30 313.73 NA NA
09:52:00 316.11 NA NA
09:52:10 NA 400.86 221.72
09:52:30 331.65 NA NA
09:52:54 NA 404.81 235.02
09:53:00 325.31 NA NA
09:53:30 334.33 NA NA
09:53:41 NA 404.36 262.85
09:54:00 334.54 NA NA
09:54:20 NA 406.11 306.64
09:54:30 336.55 NA NA
09:55:00 339.34 NA NA
09:55:03 NA 408.85 346.30
09:55:30 341.93 NA NA
packageDescription("zoo")$Version
[1] "1.6-1"
R.version.string # Windows Vista
[1] "R version 2.10.0 Patched (2009-11-21 r50532)"
On Mon, Nov 23, 2009 at 5:25 AM, e-letter <inpost at gmail.com> wrote:
Readers,
I have tried to use the zoo package to merge datasets and then use the
coplot function, but the graph is not fully created. Only the panel
data is shown. Command terminal output below, with csv files. What is
the meaning of the warning message? Can anyone help please?
rhelpatconference.jabber.org
r 251
mandriva 2008
Warning messages:
1: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
2: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
3: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
4: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
5: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)
6: Index vectors are of different classes: integer times in:
merge.zoo(e1, e2, all = FALSE, retclass = NULL)