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

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-2 Acrecca-3 Acrecca-4 Acrecca-1 Acrecca-5 Acrecca-6 Acrecca-7 #> 1 300 18.9548 17.0896 14.7003 22.3388 11.7920 9.8451 7.7388 #> 2 301 18.4392 16.9199 13.5288 22.1828 11.9167 9.8450 7.9238 #> 3 302 19.1466 16.4382 14.2170 21.0080 11.5350 9.8310 8.4943 #> 4 303 19.0098 16.2978 13.7924 21.5870 11.9027 9.6512 7.7345 #> 5 304 18.0937 16.3787 13.2823 21.3067 11.4466 9.6831 8.1755 #> 6 305 18.0854 16.2797 13.9877 21.8222 11.7840 10.1984 8.9242 #> Acrecca-8 Acrecca-9 Acrecca-10 Acrecca-11 #> 1 6.6097 5.7958 5.7655 5.8376 #> 2 6.6676 5.9672 5.6908 5.6719 #> 3 6.7162 5.9854 5.5914 5.6945 #> 4 7.1378 6.8542 5.8837 6.5800 #> 5 6.9856 6.0488 4.7887 5.4050 #> 6 7.6159 6.7029 6.4119 6.4612
par(mfrow = c(1, 2)) plot(teal.mer) plot(teal)