mapply(), was Re: [Rd] sprintf

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 16 Feb 2005 - 00:41:03 EST

Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:

> sprintf() in R-devel is now vectorized, re-cycling its arguments,
> including fmt, as required.

Thanks, Brian.

This leaves me with one question: what is actually the wisdom behind the USE.NAMES default in mapply? Seems to me that it gets in the way more often that it is useful (and has some real problems with recycling, clearly). Thomas?

> >>> mapply(sprintf, "%04d %s", 1:3, "abc", USE.NAMES=FALSE)
> >> [1] "0001 abc" "0002 abc" "0003 abc"

> >> if (USE.NAMES && length(dots) && is.character(dots[[1]]) &&
> >> is.null(names(answer)))
> >> names(answer) <- dots[[1]]
> >> )

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue Feb 15 23:57:27 2005

This archive was generated by hypermail 2.1.8 : Wed 16 Feb 2005 - 01:41:29 EST