Libraries, Data, and LMER Model
I am using these three libraries for this inquiry:
#### Libraries ####
library(lmerTest)
library(performance)
library(partR2)
I have built a lmer model using this data:
structure(list(Mins_Work = c(435L, 350L, 145L, 135L, 15L, 60L,
60L, 390L, 395L, 395L, 315L, 80L, 580L, 175L, 545L, 230L, 435L,
370L, 255L, 515L, 330L, 65L, 115L, 550L, 420L, 45L, 266L, 196L,
198L, 220L, 17L, 382L, 0L, 180L, 343L, 207L, 263L, 332L, 0L,
0L, 259L, 417L, 282L, 685L, 517L, 111L, 64L, 466L, 499L, 460L,
269L, 300L, 427L, 301L, 436L, 342L, 229L, 379L, 102L, 146L, 94L,
345L, 73L, 204L, 512L, 113L, 135L, 458L, 493L, 552L, 108L, 335L,
395L, 508L, 546L, 396L, 159L, 325L, 747L, 650L, 377L, 461L, 669L,
186L, 220L, 410L, 708L, 409L, 515L, 413L, 166L, 451L, 660L, 177L,
192L, 191L, 461L, 637L, 297L, 601L, 586L, 270L, 479L, 0L, 480L,
397L, 174L, 111L, 0L, 610L, 332L, 345L, 423L, 160L, 611L, 0L,
345L, 550L, 324L, 427L, 505L, 632L, 560L, 230L, 495L, 235L, 522L,
654L, 465L, 377L, 260L, 572L, 612L, 594L, 624L, 237L, 0L, 38L,
409L, 634L, 292L, 706L, 399L, 568L, 0L, 694L, 298L, 616L, 553L,
581L, 423L, 636L, 623L, 338L, 345L, 521L, 438L, 504L, 600L, 616L,
656L, 285L, 474L, 688L, 278L, 383L, 535L, 363L, 470L, 457L, 303L,
123L, 363L, 329L, 513L, 636L, 421L, 220L, 430L, 428L, 536L, 156L,
615L, 429L, 103L, 332L, 250L, 281L, 248L, 435L, 589L, 515L, 158L,
0L, 649L, 427L, 193L, 225L, 0L, 280L, 163L, 536L, 301L, 406L,
230L, 519L, 0L, 303L, 472L, 392L, 326L, 368L, 405L, 515L, 308L,
259L, 769L, 93L, 517L, 261L, 420L, 248L, 265L, 834L, 313L, 131L,
298L, 134L, 385L, 648L, 529L, 487L, 533L, 641L,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0L, 0L, 0L, 0L, 0L, 0L, 0L, 3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 3L, 5L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 3L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 3L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 3L, 0L, 0L, 0L,
0L, 0L, 3L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 3L, 1L, 0L, 0L, 0L, 0L, 0L,
0L)), class = "data.frame", row.names = c(NA, -279L))
This is the model itself:
model.work <- lmer(Mins_Work ~ Coffee_Cups + Tea_Cups +
(1|Month_Name),
data = work)
Solution So Far
Based off the instructions here for the partR2 package, I have calculated beta weights, inclusive R2, and part R2. First, by automatically calculating it with this code:
#### Obtain Part R2 ####
part.work <- partR2(model.work,
partvars = c("Coffee_Cups",
"Tea_Cups"),
data = work,
nboot = 100)
summary(part.work)
I obtain the numbers for each:
R2 (marginal) and 95% CI for the full model:
R2 CI_lower CI_upper ndf
0.105 0.0557 0.1771 3
----------
Part (semi-partial) R2:
Predictor(s) R2 CI_lower CI_upper ndf
Model 0.1050 0.0557 0.1771 3
Coffee_Cups 0.1011 0.0518 0.1734 2
Tea_Cups 0.0015 0.0000 0.0773 2
Coffee_Cups+Tea_Cups 0.1050 0.0557 0.1771 1
----------
Inclusive R2 (SC^2 * R2):
Predictor IR2 CI_lower CI_upper
Coffee_Cups 0.0999 0.0491 0.1707
Tea_Cups 0.0012 0.0000 0.0171
----------
Structure coefficients r(Yhat,x):
Predictor SC CI_lower CI_upper
Coffee_Cups 0.9753 0.8541 0.9993
Tea_Cups 0.1077 -0.2130 0.4190
----------
Beta weights (standardised estimates)
Predictor BW CI_lower CI_upper
Coffee_Cups 0.3262 0.2362 0.4283
Tea_Cups 0.0724 -0.0322 0.1700
----------
I have manually obtained all these measures with the following code:
#### Manually Calculate Pseudo R Square ####
var.ran <- get_variance_random(model.work, verbose = TRUE)
var.fix <- get_variance_fixed(model.work, verbose = TRUE)
var.res <- get_variance_residual(model.work, verbose = TRUE)
var.ran # random effect variance
var.res # residual variance
var.fix # fixed effect variance
mar.r.square <- (var.fix/(var.fix+var.ran+var.res))
con.r.square <- ((var.fix+var.ran)/(var.fix+var.ran+var.res))
mar.r.square # effect of fixed factors
con.r.square # effect of fixed and random
mar.r.square-con.r.square # # effect of random
#### Manually Calculate Part R2 ####
reduced <- lmer(Mins_Work ~ Tea_Cups +
(1|Month_Name),
data = work)
reduced.fix <- get_variance_fixed(reduced)
(var.fix-reduced.fix)/(var.fix+var.ran+var.res) # coffee part R2
#### Manually Calculate Beta Weights ####
25.45*sd(work$Coffee_Cups)/sd(work$Mins_Work) # coffee predictor
10.39*sd(work$Tea_Cups)/sd(work$Mins_Work) # tea predictor
#### Manually Calculate Inclusive R2 ####
.9753^2*.105 # coffee predictor
.1077^2*.105 # tea predictor
Problem
The single value I am still having issues with obtaining is the structure coefficient for each predictor. This is supposedly obtained by measuring the correlation between predicted y and a single predictor x. I tried doing this with the following code:
cor(predict(model.work),work$Coffee_Cups)
Which gives me this value:
1] 0.8222992
This however doesn't match the value in the summarized output from the partR2 function:
Structure coefficients r(Yhat,x):
Predictor SC CI_lower CI_upper
Coffee_Cups 0.9753 0.8541 0.9993
What am I missing here? Am I reading something wrong?
I have 4 data frames and I want to combines these data based on date. I want to create a new dataframe and merge data only when all of the data frames have the same common date. The data for 4 data frames are as follows:
coffee <- structure(list(date = structure(list(sec = c(0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,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 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L), mon = c(0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L), year = c(110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 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 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("sec", "min",
"hour", "mday", "mon", "year", "wday", "yday", "isdst"), class = c("POSIXlt",
"POSIXt")), discharge = c(46200, 46300, 46400, 46500, 46500,
46600, 46500, 46600, 46600, 46500, 46500, 46500, 46400, 46400,
46300, 46300, 40700, 40700, 40600, 40500, 40500, 40400, 40400,
40400, 40300, 40300, 40200, 33800, 34300, 34600, 35000, 35200,
35300, 35500, 35600, 38300, 38000, 37900, 37800, 37700, 37600,
37400, 37400, 37200, 37100, 37000, 36900, 33000, 33300, 33400,
33500, 33600, 33600, 33600, 33600, 33500, 33500, 33500, 33500,
33400, 34000, 31600, 31600, 31600, 31700, 31700, 31600, 31600,
31500, 31400, 31400, 31300, 31200, 31100, 31000, 32100, 32500,
32700, 32800, 32800, 32900, 32900, 32900, 32900, 32800, 32900,
32900, 32900, 32800, 32800, 32700, 32700, 32700, 32600, 32700,
32600, 32600, 32600, 32600, 32600)), .Names = c("date", "discharge"
), row.names = 3:102, class = "data.frame")
borne <- structure(list(date = structure(list(sec = c(0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L), mon = c(0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L), year = c(110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L,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, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("sec", "min",
"hour", "mday", "mon", "year", "wday", "yday", "isdst"), class = c("POSIXlt",
"POSIXt")), discharge = c(78500, 74100, 77600, 75600, 79000,
75500, 76600, 72300, 75700, 75400, 75700, 78700, 76900, 76500,
72800, 75100, 74700, 80200, 75200, 74900, 74700, 73600, 69900,
73600, 70600, 74100, 75800, 73100, 71400, 72300, 71300, 72400,
72700, 72200, 69400, 72600, 68900, 67700, 66000, 64800, 66700,
68400, 65500, 66600, 63600, 106000, 106000, 109000, 110000, 110000,
110000, 110000, 114000, 112000, 112000, 111000, 110000, 109000,
108000, 108000, 106000, 105000, 110000, 113000, 113000, 112000,
111000, 110000, 93500, 62600, 62700, 63300, 63300, 63300, 63300,
63000, 63200, 62900, 62600, 62900, 62500, 62400, 62900, 62800,
62200, 62500, 62200, 62100, 62200, 62100, 59300, 60000, 60000,
60100, 60500, 60700, 60800, 60700, 60900, 61100)), .Names = c("date",
"discharge"), row.names = 3:102, class = "data.frame")
buk <-structure(list(date = structure(list(sec = c(0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0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L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L), mon = c(0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L), year = c(110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L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L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("sec", "min",
"hour", "mday", "mon", "year", "wday", "yday", "isdst"), class = c("POSIXlt",
"POSIXt")), discharge = c(78500, 74100, 77600, 75600, 79000,
75500, 76600, 72300, 75700, 75400, 75700, 78700, 76900, 76500,
72800, 75100, 74700, 80200, 75200, 74900, 74700, 73600, 69900,
73600, 70600, 74100, 75800, 73100, 71400, 72300, 71300, 72400,
72700, 72200, 69400, 72600, 68900, 67700, 66000, 64800, 66700,
68400, 65500, 66600, 63600, 106000, 106000, 109000, 110000, 110000,
110000, 110000, 114000, 112000, 112000, 111000, 110000, 109000,
108000, 108000, 106000, 105000, 110000, 113000, 113000, 112000,
111000, 110000, 93500, 62600, 62700, 63300, 63300, 63300, 63300,
63000, 63200, 62900, 62600, 62900, 62500, 62400, 62900, 62800,
62200, 62500, 62200, 62100, 62200, 62100, 59300, 60000, 60000,
60100, 60500, 60700, 60800, 60700, 60900, 61100)), .Names = c("date",
"discharge"), row.names = 3:102, class = "data.frame")
ten <- structure(list(date = structure(list(sec = c(0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0), min = c(30L, 0L, 30L, 0L, 30L,
0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L,
0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L,
0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L,
0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L,
0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L,
0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L,
0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L, 30L, 0L), hour = c(0L,
1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L,
9L, 9L, 10L, 10L, 11L, 11L, 12L, 12L, 13L, 13L, 14L, 14L, 15L,
15L, 16L, 16L, 17L, 17L, 18L, 18L, 19L, 19L, 20L, 20L, 21L, 21L,
22L, 22L, 23L, 23L, 0L, 0L, 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L,
5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L, 11L, 11L, 12L,
12L, 13L, 13L, 14L, 14L, 15L, 15L, 16L, 16L, 17L, 17L, 18L, 18L,
19L, 19L, 20L, 20L, 21L, 21L, 22L, 22L, 23L, 23L, 0L, 0L, 1L,
1L, 2L), mday = c(31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L,
31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L,
31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L,
31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L,
4L, 4L, 4L, 4L), mon = c(11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L), year = c(109L, 109L, 109L, 109L, 109L, 109L,
109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L,
109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L,
109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L,
109L, 109L, 109L, 109L, 109L, 109L, 109L, 109L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L, 110L,
110L, 110L, 110L, 110L, 110L, 110L), wday = c(4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L
), yday = c(364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L,
364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L,
364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L,
364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L, 364L,
364L, 364L, 364L, 364L, 364L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L), isdst = c(0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L)), .Names = c("sec", "min", "hour", "mday", "mon",
"year", "wday", "yday", "isdst"), class = c("POSIXlt", "POSIXt"
)), discharge = c(51000, 50300, 50700, 49800, 50800, 50700, 50500,
50500, 50800, 50700, 50300, 50800, 50600, 50500, 50100, 50500,
50100, 50600, 49600, 50600, 49900, 49900, 50600, 50300, 50800,
49700, 50200, 50700, 49000, 51100, 50600, 50900, 50900, 51000,
50700, 50800, 51700, 52000, 51000, 51100, 52000, 51300, 51600,
51800, 52100, 51400, 51500, 54800, 54600, 54100, 54100, 54900,
53900, 54000, 54500, 54700, 53800, 54100, 53900, 53700, 53900,
54500, 53100, 54000, 54000, 53300, 52800, 53300, 53000, 53700,
54200, 53200, 53700, 53500, 54000, 53300, 53600, 55000, 53500,
52800, 54000, 53600, 55300, 54300, 53600, 54400, 54400, 54000,
54200, 53800, 53600, 53400, 54300, 53200, 53500, 53500, 53700,
52900, 53600, 53300)), .Names = c("date", "discharge"), row.names = 16094:16193, class = "data.frame")
Now, I want to merge the above mentioned data frames based on the common date. All the data frames should have data/discharge on the same data. For example all the data frames have data on 2010-01-01 00:00, then I want to take all the data and if one data frame has half hourly data I would want to check if the data interval and exact date match with other data frames. Finally, I need a solution where all the data are listed for the common dates.
I cannot directly use rbind here because some of the data is missing.
You can use merge but you should coerce your POSIXlt to POSIXct or date, since the first is of type list. Here I am using Reduce to process all the list once.
Reduce(function(x,y){
x$date <- as.POSIXct(x$date)
y$date <- as.POSIXct(y$date)
merge(x,y,by='date')},
list(coffee,borne,buk,ten))
# date discharge.x discharge.y discharge.x discharge.y
# 1 2010-01-03 00:00:00 33300 110000 110000 54800
# 2 2010-01-03 01:00:00 33400 110000 110000 54100
# 3 2010-01-03 02:00:00 33500 110000 110000 54900
# 4 2010-01-03 03:00:00 33600 110000 110000 54000
# 5 2010-01-03 04:00:00 33600 114000 114000 54700
# 6 2010-01-03 05:00:00 33600 112000 112000 54100
# 7 2010-01-03 06:00:00 33600 112000 112000 53700