Created
June 16, 2015 13:22
-
-
Save lsaravia/ea32a9a733c139339311 to your computer and use it in GitHub Desktop.
Test siber.hull.metrics from SIAR R package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(plyr) | |
require(siar) | |
t1 <- data.frame(SizeClass=c("Meiofauna","Smaller Macrofauna","Bigger Macrofauna"), | |
num=rpois(3,10), | |
md13C=rnorm(3,-10,10), | |
sd13C=rlnorm(3,1,1), | |
md15N=rnorm(3,5,5) , | |
sd15N=rlnorm(3,1,1)) | |
t1 | |
hh <- function(x) { | |
with(x,data.frame(SizeClass=SizeClass, | |
# d13C=rnorm(num,md13C,sd13C),d15N=rlnorm(num,log(md15N),log(sd15N))) | |
d13C=rnorm(num,md13C,sd13C),d15N=rnorm(num,md15N,sd15N))) | |
} | |
t2 <- ddply(t1, .(SizeClass), hh) | |
t3 <- with(t2,siber.hull.metrics(d13C,d15N,SizeClass,R=10^4)) | |
# | |
# Error: not a matrix | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment