[R] last.warning and function problem

Marta Rufino mrufino at cmima.csic.es
Tue Nov 5 16:52:58 CET 2002


Hello,

I am a newbie in R and I am trying to create a function, that includes
several functions inside.
To avoid that everything stops if there is an error, I have this statement 

bla = function(....){
...
if(exists("last.warning")){rm(last.warning)}
...
}

inside the function, which if I use it normally, it works fine, but once I
use it with the funciotn it gives me an error like:

$"remove: variable "last.warning" was not found"
NULL

which breaks my function.
I just want to make it do: if exists the file last warning, remove it, if
not, just proceed...
Does anyone knows why this happens? How can I avoid it?
Thanks in advance.
Marta 
    

><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>
`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>`·.¸¸.·´

Marta Rufino

Centre Mediterrani d'Investigacions Marines i Ambientals
(CMIMA). CSIC
Passeig Maritim 37-49
08003  BARCELONA

Tfno:34 93 230 95 40
Tfax:34 93 230 95 55

><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>
`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>`·.¸¸.·´


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list