[Rd] Print bug for matrix(list(NA_complex_, ...))

2009-06-02 Thread Stavros Macrakis
In R 2.8.0 on Windows (tested both under ESS and under R Console in case there was an I/O issue) There is a bug in printing val <- matrix(list(NA_complex_,NA_complex_),1). > dput(val) structure(list(NA_complex_, NA_complex_), .Dim = 1:2) > print(val) [,1] [1,] [,2] [1,] Note that a large

[Rd] reference counting bug related to break and next in loops

2009-06-02 Thread William Dunlap
One of our R users here just showed me the following problem while investigating the return value of a while loop. I added some information on a similar bug in for loops. I think he was using 2.9.0 but I see the same problem on today's development version of 2.10.0 (svn 48703). Should the semant

[Rd] Vectorize fails for function with ... arglist

2009-06-02 Thread Stavros Macrakis
Vectorize is defined to return a function that acts as if 'mapply' was called. So we have: > mapply(dput,1:2)# mapply form 1L # calls dput on each element of 1:2 2L [1] 1 2 > Vectorize(dput)(1:2)# Vectorize form 1L

[Rd] How to generate R objects in C?

2009-06-02 Thread Kynn Jones
I'm in the process of coding a parser (in C) to generate R entities (vectors, lists, etc.) from a text description (different from R). The basic parser works, and now I need to tell it how to create R entities. I need to be able to create character vectors (for unicode strings), integers, floats,

[Rd] statutes of R Foundation

2009-06-02 Thread Christophe Dutang
Good evening all, I realised yesterday that the R Foundation statutes doc was only available in English and in German. I tried to translate into French: a first version is available here http://dutangc.free.fr/pub/statut%20R.pdf . Could you please tell me what do you think of my translati

Re: [Rd] setdiff bizarre

2009-06-02 Thread Stavros Macrakis
On Tue, Jun 2, 2009 at 1:18 PM, William Dunlap wrote: > %in% is a thin wrapper on a call to match(). Yes, as I mentioned in my email, all this is clearly documented in ? match. > match() is not a generic function (and is not documented to be one), > so it treats data.frames as lists, as their

Re: [Rd] setdiff bizarre

2009-06-02 Thread Wacek Kusnierczyk
Barry Rowlingson wrote: [...] > I suspect it's using 'deparse()' to get the character representation. > This function is mentioned in ?as.character, but as.character.default > disappears into the infernal .Internal and I don't have time to chase > source code - it's sunny outside! > on the si

Re: [Rd] Recommendations for a quick UI.

2009-06-02 Thread Greg Snow
Some possibilities: The Rcmdr package is a very good example of a GUI built using Tk (it does not hide the R program, but lets you do analyses using menus and dialogs). Rcmdr also has a plug-in mechanism to write extensions to it, depending on what you want to do, writing a simple extension to

Re: [Rd] setdiff bizarre

2009-06-02 Thread William Dunlap
> > ... > > The related functions, duplicated() and unique(), do have > > row-wise data.frame methods. E.g., > >> duplicated(data.frame(x=c(1,2,2,3,3),y=letters[c(1,1,2,2,2)])) > >[1] FALSE FALSE FALSE FALSE TRUE > > Perhaps match() ought to have one also. S+'s match is generic > > and

Re: [Rd] setdiff bizarre

2009-06-02 Thread Wacek Kusnierczyk
William Dunlap wrote: > %in% is a thin wrapper on a call to match(). match() is > not a generic function (and is not documented to be one), > so it treats data.frames as lists, as their underlying > representation is a list of columns. match is documented > to convert lists to character and to th

Re: [Rd] setdiff bizarre (was: odd behavior out of setdiff)

2009-06-02 Thread Barry Rowlingson
On Tue, Jun 2, 2009 at 4:13 PM, Stavros Macrakis wrote: > but simply treats the data frame as a *character* list: > >     1 %in% data.frame(a=2,b=1)  # TRUE >     '1' %in% data.frame(a=2,b=1)  # TRUE >     1 %in% data.frame(a=2:3,b=1:2) # FALSE >     1:3 %in% data.frame(a=2:4,b=1:3)  # FALSE FALS

Re: [Rd] setdiff bizarre

2009-06-02 Thread William Dunlap
%in% is a thin wrapper on a call to match(). match() is not a generic function (and is not documented to be one), so it treats data.frames as lists, as their underlying representation is a list of columns. match is documented to convert lists to character and to then run the character version of

Re: [Rd] setdiff bizarre

2009-06-02 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > > '1:3' %in% data.frame(a=2:4,b=1:3) # TRUE > utterly weird. so what would x have to be so that x %in% data.frame('a') # TRUE hint: '1' %in% data.frame(1) # TRUE vQ __ R-devel@r-project.org mailin

Re: [Rd] formal argument "envir" matched by multiple actual arguments

2009-06-02 Thread luke
On Tue, 2 Jun 2009, Henrik Bengtsson wrote: Nice case - I think you're onto something. /Henrik 2009/6/2 : In fact reg.finalizer() looks like a dangerous feature. If the finalizer itself triggers (implicitely or explicitely) garbage collection, then bad things happen. In the following example

Re: [Rd] Recommendations for a quick UI.

2009-06-02 Thread Stavros Macrakis
On Mon, Jun 1, 2009 at 9:21 AM, Martin Maechler wrote: > > "AB" == Alex Bokov on Mon, 01 Jun 2009 00:24:58 > -0500 writes: > >AB> I'm trying to wrap my R package in a GUI such that when >AB> the user launches the app, they see my GUI window and >AB> never interact with the R cons

Re: [Rd] reference counting bug: overwriting for loop 'seq' variable

2009-06-02 Thread luke
Thanks for the report. Should be fixed in teh devel and 2.9 branches. luke On Mon, 1 Jun 2009, William Dunlap wrote: It looks like the 'seq' variable to 'for' can be altered from within the loop, leading to incorrect answers. E.g., in the following I'd expect 'sum' to be 1+2=3, but R 2.10.0

Re: [Rd] setdiff bizarre (was: odd behavior out of setdiff)

2009-06-02 Thread Stavros Macrakis
On Sat, May 30, 2009 at 11:59 AM, Stavros Macrakis wrote: > Since R is object-oriented, data frame set operations should be the natural > operations for their class. There are, I suppose, two natural ways: the > column-wise (variable-wise) and the row-wise (observation-wise) one. The > row-wise

[Rd] qpois documentation (PR#13743)

2009-06-02 Thread Jerry . Lewis
Full_Name: Jerry W. Lewis Version: 2.9.0 OS: Windows XP Professional Submission from: (NULL) (166.186.168.103) Quantiles for discrete distributions are consitently implemented, but inconsitently documented. Help for qpois incorrectly states in the Details section that "The quantile is left con

Re: [Rd] Recommendations for a quick UI.

2009-06-02 Thread Thomas Baier
Alex, Kevin R. Coombes wrote: > The following idea only partially answers your question > > I have successfully written a GUI using the tcl/tk package > that ships with standard R. It is then possible (in Windows) > to create a shortcut icon that runs the following command: > C:\R\R-2.8.1

Re: [Rd] The default position of plot title

2009-06-02 Thread Ben Bolker
ronggui-2 wrote: > > Dear R-developers, > > It seems to me that the position of title is usually at the bottom of > a plot in sociological and political science books and articles. I > wonder if the same convention applies in other disciplines. If yes, is > it reasonable to change the default

[Rd] warning: some HTML links ...

2009-06-02 Thread Daniel Wright
Hi Everyone, I am getting a warning when I build and package from windows. The warning is "some HTML links may not be found". Through some searching I found this probably has to do with the Microsoft HTML Help Workshop, but I have installed it (a few times) from the different locations in the m

Re: [Rd] S4 Objects [Sec=Unclassified]

2009-06-02 Thread Martin Morgan
Hi Troy -- Troy Robertson wrote: > I am new to R programming but have dived into a medium sized modelling > software development project. > > Having come from a Java OO background I have a couple of questions about S4 > objects. > > > > Is there a way to make S4 slots (and methods) private a

Re: [Rd] install.packages hangs RGui with frozen rpwd process at bottom of process tree (PR#13734)

2009-06-02 Thread Ben Bolker
astokes wrote: > > Full_Name: Allan Stokes > Version: 2.8.1 > OS: XP > Submission from: (NULL) (24.108.0.245) > > > I've just spent a hellish six hours trying to create my own R package with > a > bare bones "hello world" R function inside. I was able to create a > package.tar.gz file eventu

[Rd] cryptic error message from R CMD check

2009-06-02 Thread Marco Scutari
Dear R developers, I've run into a very cryptic error message from R CMD check while working on a new package. This is the relevant output: [fiz...@~/Rmap]:R CMD check Rmap * checking for working pdflatex ... OK * using log directory '/home/fizban/Rmap/Rmap.Rcheck' * using R version 2.9.0 (2009-0

Re: [Rd] formal argument "envir" matched by multiple actual arguments

2009-06-02 Thread Henrik Bengtsson
Nice case - I think you're onto something. /Henrik 2009/6/2 : > In fact reg.finalizer() looks like a dangerous feature. > > If the finalizer itself triggers (implicitely or > explicitely) garbage collection, then bad things happen. > In the following example, garbage collection is triggered > exp

[Rd] Bug in so_strsplit (PR#13742)

2009-06-02 Thread waku
Full_Name: Wacek Kusnierczyk Version: 2.10.0 r48689 OS: Ubuntu 8.04 Linux 32b Submission from: (NULL) (129.241.199.78) src/main/character.c:435-438 (do_strsplit) contains the following code: for (i = 0; i < tlen; i++) if (getCharCE(STRING_ELT(tok, 0)) == CE_UTF8) use_UTF8 = TRUE;

Re: [Rd] formal argument "envir" matched by multiple actual arguments

2009-06-02 Thread Henrik Bengtsson
Hi. 2009/6/1 Hervé Pagès : > Hi list, > > This looks similar to the problem reported here >  https://stat.ethz.ch/pipermail/r-devel/2006-April/037199.html > by Henrik Bengtsson a long time ago. It is very sporadic and > non-reproducible. > Henrik, do you remember if your code was using reg.finaliz

[Rd] The default position of plot title

2009-06-02 Thread Ronggui Huang
Dear R-developers, It seems to me that the position of title is usually at the bottom of a plot in sociological and political science books and articles. I wonder if the same convention applies in other disciplines. If yes, is it reasonable to change the default position of main title of plot func

Re: [Rd] formal argument "envir" matched by multiple actual arguments

2009-06-02 Thread hpages
In fact reg.finalizer() looks like a dangerous feature. If the finalizer itself triggers (implicitely or explicitely) garbage collection, then bad things happen. In the following example, garbage collection is triggered explicitely (using R-2.9.0): setClass("B", representation(bb="environment

Re: [Rd] reference counting bug: overwriting for loop 'seq' variable

2009-06-02 Thread Wacek Kusnierczyk
William Dunlap wrote: > It looks like the 'seq' variable to 'for' can be altered from > within the loop, leading to incorrect answers. E.g., in > the following I'd expect 'sum' to be 1+2=3, but R 2.10.0 > (svn 48686) gives 44.5. > >> x = c(1,2); sum = 0; for (i in x) { x[i+1] = i + 42.5; sum