Re: [R] Symbolic substitution in parallel; use infinity symbol?

2008-01-01 Thread John Maindonald
Actually this works beautifully as it stands: breaks <- c(-Inf, -1, 1, Inf) zz <- lapply(breaks, function(x) if(x==-Inf) quote(-infinity) else if (x==Inf) quote(infinity) else format(x)) lbl <- mapply(function(x,y) bquote("(" * .(x) * "," * .(y) * "]"),

Re: [R] Symbolic substitution in parallel; use infinity symbol?

2007-12-31 Thread Bert Gunter
to:[EMAIL PROTECTED] On Behalf Of John Maindonald Sent: Sunday, December 30, 2007 3:45 PM To: [EMAIL PROTECTED] Subject: [R] Symbolic substitution in parallel; use infinity symbol? I'd like to be able to modify axlab in (C) below so that 'Inf' is replaced by the infinity sy

Re: [R] Symbolic substitution in parallel; use infinity symbol?

2007-12-30 Thread Peter Dalgaard
John Maindonald wrote: > I'd like to be able to modify axlab in (C) below so that 'Inf' > is replaced by the infinity symbol. > > y <- rnorm(40) > breaks <- c(-Inf, -1, 1, Inf) > x <- cut(y, breaks=breaks) > plot(unclass(x), y, xaxt="n", xlab="") > > ## A: The following gives the axis labels "(-Inf

[R] Symbolic substitution in parallel; use infinity symbol?

2007-12-30 Thread John Maindonald
I'd like to be able to modify axlab in (C) below so that 'Inf' is replaced by the infinity symbol. y <- rnorm(40) breaks <- c(-Inf, -1, 1, Inf) x <- cut(y, breaks=breaks) plot(unclass(x), y, xaxt="n", xlab="") ## A: The following gives the axis labels "(-Inf, 1]", etc. axis(1, at=1:3, labels=exp