merge_results: Merge two slidingwin analyses.

Description Usage Arguments Value Author(s) Examples

View source: R/otherfunctions.R View source: R/merge_results.R

Description

Merges outputs of two separate slidingwin analyses.

Usage

1
merge_results(dataset1, dataset2)

Arguments

dataset1, dataset2

The slidingwin outputs to be merged. Note that all elements (i.e. Dataset, BestModel, BestModelData) will be merged and do not need to be specified.

Value

A list object, identical to that produced by slidingwin, containing all records from both outputs.

Author(s)

Liam D. Bailey and Martijn van de Pol

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Not run: 
 
data(Offspring) 
data(OffspringClimate)

# Test a linear functions

OffspringWin_lin <- slidingwin(xvar = list(Temp = OffspringClimate$Temperature), 
                              cdate = OffspringClimate$Date, 
                              bdate = Offspring$Date, 
                              baseline = glm(Offspring ~ 1, data = Offspring, family = poisson),
                              range = c(150, 0), 
                              type = "relative", stat = "mean", 
                              func = c("lin"), cmissing = FALSE, cinterval = "day")

# Test a quadratic functions

OffspringWin_quad <- slidingwin(xvar = list(Temp = OffspringClimate$Temperature), 
                               cdate = OffspringClimate$Date, 
                               bdate = Offspring$Date, 
                               baseline = glm(Offspring ~ 1, data = Offspring, family = poisson),
                               range = c(150, 0), 
                               type = "relative", stat = "mean", 
                               func = c("quad"), cmissing = FALSE, cinterval = "day")
                               
# Combine these outputs

OffspringWin_comb <- merge_results(dataset1 = OffspringWin_lin, dataset2 = OffspringWin_quad)

#View analyses contained in the new output

OffspringWin_comb$combos

#View output from linear analysis

head(OffspringWin_comb[[1]]$Dataset)


## End(Not run)
       

climwin documentation built on Nov. 17, 2017, 7:34 a.m.