[R] Turning off return warning messages.

Mulholland, Tom Tom.Mulholland at dpi.wa.gov.au
Wed Jul 20 09:01:39 CEST 2005


doubleEm <- function(p1,p2,p3,p4){return(p1 *p1,p2 * p2, p3 * p3, p4 * p4)}
suppressWarnings(doubleEm(1,2,3,4)) 
[[1]]
[1] 1

[[2]]
[1] 4

[[3]]
[1] 9

[[4]]
[1] 16

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Paul Roebuck
> Sent: Wednesday, 20 July 2005 1:50 PM
> To: R Help Mailing List
> Subject: Re: [R] Turning off return warning messages.
> 
> 
> On Wed, 20 Jul 2005, Steve Su wrote:
> 
> > Is there a way I can turn off the following warning message
> > for using multi-argument returns?
> >
> > multi-argument returns are deprecated in: return(p1, p2, p3, p4)
> 
> doubleEm <- function(p1, p2, p3, p4) {
>     return(list(p1 = p1*p1,
>                 p2 = p2*p2,
>                 p3 = p3*p3,
>                 p4 = p4*p4))
> }
> 
> res <- doubleEm(1, 2, 3, 4)
> cat("p3 =", res$p3, "\n")
> 
> ----------------------------------------------------------
> SIGSIG -- signature too long (core dumped)
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list