if (FALSE) {
# nothing happens if no error occurs
data(dataEP05A2_1)
res <- protectedCall(anovaVCA(form=y~day/run, Data=dataEP05A2_1))
res
# error message without additional consistency checks (default)
dat3 <- data.frame( y=rnorm(8,10),
day=rep(c(1,2),c(4,4)),
run=rep(c(2,1), c(4,4)))
protectedCall(anovaVCA(form=y~day/run, Data=dat3), ErrorType="Simple")
# error message with additional consistency checks hopefully helpful for the user
protectedCall(anovaVCA(form=y~day/run, Data=dat3), ErrorType="Detailed")
# handle error
res <- try(protectedCall(anovaVCA(form=y~day/run, Data=dat3), ErrorType="Detailed"), silent=TRUE)
if(is(res, "try-error"))
cat(sub(", ErrorType .*\\)", "", sub("protectedCall\\(", "", res)))
# inline-definition of data.frames issues an error
protectedCall(anovaVCA( form=y~day/run,
Data=data.frame(y=rnorm(8,10),
day=rep(c(1,2),c(4,4)),
run=rep(c(2,1), c(4,4)))))
}
Run the code above in your browser using DataLab