Description Usage Arguments Note See Also Examples
View source: R/group_methods.R
Apply a binary Ops group method to the observation values of "uts" objects.
1  | binary_Ops(x, Ops, y, times = "all", interpolation = "last")
 | 
x, y | 
 
  | 
Ops | 
 a binary   | 
times | 
 which observation times to use for the output time series: 
 In all three cases, times before the first observation time (i.e. the start time) of either time series are excluded.   | 
interpolation | 
 either   | 
Ops.uts, when using a binary operator, is a special case of this method. Specifically, x+y gives the same result as binary_Ops(x, "+", y, times="all", interpolation="last"), and the same is true for the other binary "Ops" groupOps methods.
For output times that are observation times of x (or y), the interpolation method has no effect, because the sampled value at such a time point is simply the observation value of x (or y) at this time point. In particular, the interpolation argument has no effect for times="all" (the default).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  | # Create two sample time series
x <- ex_uts()
y <- head(lag_t(x * 1.1, dhours(1)), 5)
# Vary binary operator
binary_Ops(x, "/", y)
binary_Ops(x, "-", y)
binary_Ops(x, "!=", y)
# Vary time points in output
binary_Ops(x, "/", y)
binary_Ops(x, "/", y, times="x")
binary_Ops(x, "/", y, times="y")
# Vary interpolation method
binary_Ops(x, "/", y)
binary_Ops(x, "/", y, interpolation="linear")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.