Combine: Combines two xts objects with similar data, giving preference...

Description Usage Arguments Examples

Description

Combines two xts objects with similar data, giving preference to objects first in the list.

Usage

1
Combine(listofxts)

Arguments

listofxts

xts objects to combine

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(Quandl)
ubs1 <- Quandl("GOOG/VTX_UBSN", type = "xts")
ubs2 <- ubs1
ubs3 <- ubs1

#assume ubs1 and ubs2 and ubs3 come from different
#data sources, each of which may have missing data.
#We simulate by messing with the data:

ubs1 <- ubs1[-c(3,5), ]
ubs2 <- ubs2[-3, ]
ubs3[1, 1] <- 58

#Source 1 is considered best, but sometimes
#it may have missing data which is available in 2
#or 3.
ubs <- Combine(list(ubs1, ubs2, ubs3))

gluc/datapR documentation built on May 17, 2019, 6:41 a.m.