From p.dalgaard at biostat.ku.dk  Tue Feb 15 14:41:03 2005
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Tue Feb 15 14:46:10 2005
Subject: mapply(), was Re: [Rd] sprintf
In-Reply-To: <Pine.LNX.4.61.0502151153270.21472@gannet.stats>
References: <20050211175824.5EB48DEE7@slim.kubism.ku.dk>
	<Pine.LNX.4.61.0502140956020.29523@gannet.stats>
	<4210741A.8040606@ebi.ac.uk>
	<Pine.LNX.4.61.0502141052360.30303@gannet.stats>
	<42107994.9070500@ebi.ac.uk> <x2mzu7jp4c.fsf@biostat.ku.dk>
	<4211C732.6050402@ebi.ac.uk>
	<Pine.LNX.4.61.0502151153270.21472@gannet.stats>
Message-ID: <x2zmy6j5zk.fsf_-_@biostat.ku.dk>

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


mapply(), was Re: [Rd] sprintf
Peter Dalgaard