Description Usage Arguments Value Examples
A wrapper for trycatch, which allows ignoreing of errors and leave the loop running. This is terrible behavior and should only be used when necessary
1 |
... |
whatever function you want to ignore errors from |
output of the function, or NA if something failed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data = matrix(rnorm(40), ncol = 8)
data[,5] = NA
for(i in 2:ncol(data)) {
result = t.test(data[,(i-1)], data[,i])$p.value
print(result)
}
#This halts execution at the 5'th cloumn
for(i in 2:ncol(data)) {
result = t.test(data[,(i-1)], data[,i])$p.value
print(result)
}
#Works, but returns NA when column 5 is being used
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.