Re: [Rd] capture.output(eval(..., envir)) not evaluate in the expected(?) environment

2011-11-23 Thread Henrik Bengtsson
Thanks for the quick answer. I didn't know about force() function. Cheers, Henrik On Wed, Nov 23, 2011 at 6:56 PM, Simon Urbanek wrote: > IMHO this has nothing to do with capture.output() per se - it's simply lazy > evaluation that gets you. Add force(envir) before capture.output and it works

Re: [Rd] capture.output(eval(..., envir)) not evaluate in the expected(?) environment

2011-11-23 Thread Simon Urbanek
IMHO this has nothing to do with capture.output() per se - it's simply lazy evaluation that gets you. Add force(envir) before capture.output and it works as you expected - the parent.frame() will be different inside capture.output than outside. Cheers, Simon On Nov 23, 2011, at 9:36 PM, Henri

[Rd] capture.output(eval(..., envir)) not evaluate in the expected(?) environment

2011-11-23 Thread Henrik Bengtsson
I've noticed the following oddity where capture.output() prevents eval() from evaluating an expression in the specified environment. I'm not sure if it is an undocumented feature or a bug. It caused me many hours of troubleshooting. By posting it here, it might save someone else from doing the sa

Re: [Rd] gsub, utf-8 replacements and the C-locale

2011-11-23 Thread Simon Urbanek
On Nov 23, 2011, at 6:48 PM, Hadley Wickham wrote: > Hi all, > > I'd like to discuss a infelicity/possible bug with gsub. Take the > following function: > > f <- function(x) { > gsub("\u{A0}", " ", gsub(" ", "\u{A0}", x)) > } > > As you might expect, in utf-8 locales it is idempotent: > > S

[Rd] gsub, utf-8 replacements and the C-locale

2011-11-23 Thread Hadley Wickham
Hi all, I'd like to discuss a infelicity/possible bug with gsub. Take the following function: f <- function(x) { gsub("\u{A0}", " ", gsub(" ", "\u{A0}", x)) } As you might expect, in utf-8 locales it is idempotent: Sys.setlocale("LC_ALL", "UTF-8") f("x y") # [1] "x y" But in the C locale it

Re: [Rd] Non-free packages in R-Forge

2011-11-23 Thread Dominick Samperi
2011/11/18 Spencer Graves : > Jordi: > > >      Why do you want to reduce demand for Octave by forcing people who want > to link to a commercial product to abandon Octave? > > >      Are you familiar with Shapiro and Varian (1998) Information Rules:  A > Strategic Guide to the Network Economy (Harv