sameXs: Creates two datasets with same x-values

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sameXs.R

Description

Creates two datasets with same x-values

Usage

1
sameXs(data1, data2)

Arguments

data1

data.frame; dataset, which shall have the same x-values (Dates) as data2. It must have two columns, one named 'x' and one named 'y' both containing only numeric values.

data2

data.frame; dataset, which shall have the same x-values (Dates) as data1. It must have two columns, one named 'x' and one named 'y' both containing only numeric values.

Details

Takes two datasets, it will return a list, of two data-frames, which now have the same x-values. The function will linearly interpolate the x-values for all 'xs' (from data1 and data2) for both data. the input data need to have two columns, one called x and one called y. those should include only numeric values.

Value

a list of data.frames. $data1 is the same as data1 (input) but has in addition the x-values (Dates) of data2 (input), and vice-versa.

Author(s)

Florian Berger <florian_berger@ymail.com>

See Also

scale

Examples

1
2
3
4
5
6
7
a     <- NormData(mean=0 , sd=5, n = 100)
b     <- NormData(mean=50, sd=5, n = 100)
a1    <- kernelest(a)$data
b1    <- kernelest(b)$data
dats  <- sameXs(a1,b1)
a1new <- dats[[1]]
b1new <- dats[[2]]

biometry/phenologicalOverlap documentation built on May 21, 2019, 2:31 a.m.