-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
Of Christofer Bogaso
Sent: Wednesday, June 12, 2013 12:07 PM
To: r-help
Subject: [R] Fetching and Saving warnings from a function
Hello again,
Let say I have following user defined function:
Myfn <- function(x) {
if (x < 0) {
warning("Negative value")
}
return(x)
}
Now I want to create some function which will save the Warnings from
'Myfn', so that I can use those warnings later for more analysis. Therefore
I was thinking of following type of function:
ProposedWarningStoreFunction <- function() {
......... ............ ...........
}
therefore,if I run 'ProposedWarningStoreFunction', I should get following
kind of results:
Warnings <- ProposedWarningStoreFunction({Result <- Myfn(-4)})
In Myfn(-3) : Negative value
Can somebody here point me how to achieve this? Or is it possible to
achieve at all?
Thank you for your help.
[[alternative HTML version deleted]]