Merges two rspec or data.frame objects into a single rspec object.

# S3 method for rspec
merge(x, y, ...)

Arguments

x, y

(required) rspec objects to merge.

...

additional class arguments.

Value

an object of class rspec for use with pavo functions. Will use by = "wl" if unspecified, or automatically append wl to the by argument if one is specified.

See also

Author

Chad Eliason cme16@zips.uakron.edu

Examples

# Load and split dataset into 2 sections data(teal) teal1 <- teal[, c(1, 3:5)] teal2 <- teal[, c(1, 2, 6:12)] teal.mer <- merge(teal1, teal2, by = "wl") head(teal.mer)
#> wl Acrecca-02 Acrecca-03 Acrecca-04 Acrecca-01 Acrecca-05 Acrecca-06 #> 1 300 18.9548 17.0896 14.7003 22.3388 11.7920 9.8451 #> 2 301 18.4392 16.9199 13.5288 22.1828 11.9167 9.8450 #> 3 302 19.1466 16.4382 14.2170 21.0080 11.5350 9.8310 #> 4 303 19.0098 16.2978 13.7924 21.5870 11.9027 9.6512 #> 5 304 18.0937 16.3787 13.2823 21.3067 11.4466 9.6831 #> 6 305 18.0854 16.2797 13.9877 21.8222 11.7840 10.1984 #> Acrecca-07 Acrecca-08 Acrecca-09 Acrecca-10 Acrecca-11 #> 1 7.7388 6.6097 5.7958 5.7655 5.8376 #> 2 7.9238 6.6676 5.9672 5.6908 5.6719 #> 3 8.4943 6.7162 5.9854 5.5914 5.6945 #> 4 7.7345 7.1378 6.8542 5.8837 6.5800 #> 5 8.1755 6.9856 6.0488 4.7887 5.4050 #> 6 8.9242 7.6159 6.7029 6.4119 6.4612
par(mfrow = c(1, 2)) plot(teal.mer) plot(teal)