Re: [Rd] (PR#8017) build of REventLoop package crashes with 2.1 due

2005-07-20 Thread ripley
In what way is this a bug in R?   It looks like a bug in the package, and 
as Defn.h is not part of R's API any packge using it is `at risk' (and 
cannot be installed in a binary-only installation, or even an installed 
version of R).

In particular, Defn,.h depends on config.h, and it seems you installed a 
binary version of R and used separate sources.   I would suggest building 
R from the sources, and then seeing if you can install your package into 
the build tree.

mbstate_t will be defined in wchar.h, and if configure is working 
correctly that will be included by Defn.h.  (And we have heard no reports 
to the contrary.)

On Tue, 19 Jul 2005 [EMAIL PROTECTED] wrote:

> Full_Name: Richard Boyce
> Version: 2.1.-1
> OS: Debian testing/unstable
> Submission from: (NULL) (128.95.123.29)
>
>
> While building a custom package using a modified version of Duncan's 
> REventLoop with R version 2.1 (Debian package r-base, r-base-dev) and R 
> source from apt-get source 2.1.1 I get the following error:
>
> $ R CMD build vjREventLoop
> * checking for file 'vjREventLoop/DESCRIPTION' ... OK
> * preparing 'vjREventLoop':
> * cleaning src
> * checking whether 'INDEX' is up-to-date ... NO
> * use '--force' to overwrite the existing 'INDEX'
> * removing junk files
> * building 'vjREventLoop_0.2.tar.gz'
>
> $ su
> # R CMD INSTALL vjREventLoop_0.2.tar.gz
> gcc -I/usr/lib/R/include-I/usr/src/r-base-2.1.1/src/include -fPIC  -g -O2
> -c Reventloop.c -o Reventloop.o
> In file included from /usr/src/r-base-2.1.1/src/include/IOStuff.h:30,
> from Reventloop.c:8:
> /usr/src/r-base-2.1.1/src/include/Defn.h:886: error: syntax error before
> "mbstate_t"
> Reventloop.c: In function `R_mainLoop':
> Reventloop.c:112: warning: assignment from incompatible pointer type
> Reventloop.c:156: warning: assignment from incompatible pointer type
> make: *** [Reventloop.o] Error 1
> ERROR: compilation failed for package 'vjREventLoop'
> ** Removing '/usr/local/lib/R/site-library/vjREventLoop'
> ** Restoring previous '/usr/local/lib/R/site-library/vjREventLoop'
>
> *Build works correctly with R-2.0.0 installed from source* with
> $ ./configure --prefix=/usr/local --enable-R-shlib
> $ make
> $ su
> # make install
>
> Inspection of Defn.h does not identify syntax error but I am not familiar with
> all the details. Diff (probably not useful):
> $ diff /usr/src/r-base-2.1.1/src/include/Defn.h
> /opt/Downloads/r-cran/R-2.0.0/src/include/Defn.h
>
> 4c4
> <  *  Copyright (C) 1998--2005  The R Development Core Team.
> ---
>>  *  Copyright (C) 1998--2004  The R Development Core Team.
> 472c472
> < LibExtern char*   R_Home; /* Root of the R tree */
> ---
>> extern char*  R_Home; /* Root of the R tree */
> 499c499
> < extern intR_Expressions   INI_as(5000);   /* options(expressions) */
> ---
>> extern intR_Expressions   INI_as(500);/* options(expressions) */
> 514,515c514
> < LibExtern char*   R_TempDir   INI_as(NULL);   /* Name of per-session
> dir */
> < extern char   R_StdinEnc[31]  INI_as(""); /* Encoding assumed for stdin
> */
> ---
>> extern char*  R_TempDir   INI_as(NULL);   /* Name of per-session dir */
> 530d528
> < extern void   R_setupHistory();
> 541,542c539
> < LibExtern Rboolean utf8locale  INI_as(FALSE);  /* is this a UTF-8 locale? */
> < LibExtern Rboolean mbcslocale  INI_as(FALSE);  /* is this a MBCS locale? */
> ---
>> extern Rboolean utf8locale  INI_as(FALSE);  /* is this a UTF-8 locale? */
> 596a594
>> # define duplicated   Rf_duplicated
> 633c631
> < # define Mbrtowc  Rf_mbrtowc
> ---
>> # define matchRf_match
> 686a685
>> int   R_ShowFile(char*, char*);
> 799,800c798
> < SEXP R_data_class(SEXP , Rboolean);
> < SEXP R_data_class2(SEXP);
> ---
>> SEXP R_data_class(SEXP , int);
> 864,869d861
> < typedef enum {
> < Rprt_adj_left = 0,
> < Rprt_adj_right = 1,
> < Rprt_adj_centre = 2
> < } Rprt_adj;
> <
> 872,939c864
> < char *EncodeString(SEXP, int, int, Rprt_adj);
> <
> <
> < #if defined(HAVE_WCHAR_H) && defined(SUPPORT_MBCS)
> < #include 
> < #endif
> <
> < /* main/util.c */
> < void UNIMPLEMENTED_TYPE(char *s, SEXP x);
> < void UNIMPLEMENTED_TYPEt(char *s, SEXPTYPE t);
> < Rboolean utf8strIsASCII(char *str);
> < #ifdef SUPPORT_MBCS
> < int utf8clen(char c);
> < #define mbs_init(x) memset(x, 0, sizeof(mbstate_t))
> < size_t Mbrtowc(wchar_t *wc, const char *s, size_t n, mbstate_t *ps);
> < void mbcsToLatin1(char *in, char *out);
> < Rboolean mbcsValid(char *str);
> < char *Rf_strchr(const char *s, int c);
> < char *Rf_strrchr(const char *s, int c);
> < #else
> < #define Rf_strchr(s, c) strchr(s, c)
> < #define Rf_strrchr(s, c) strrchr(s, c)
> < #endif
> < #ifdef Win32
> < void R_fixslash(char *s);
> < void R_fixbackslash(char *s);
> < #endif
> < #if defined(Win32) && defined(SUPPORT_UTF8)
> < #define mbrtowc(a,b,c,d) Rmbrtowc(a,b)
> < #define wcrtomb(a,b,c) Rwcrtomb(a,b)
> < #define mbstowcs(a,b,c) Rmbstowcs(

Re: [Rd] (PR#8017) build of REventLoop package crashes with 2.1 due

2005-07-20 Thread ripley
Looking at the REventLoop_0.2-3 sources, the problem _is_ in the package. 
It include IOStuff.h (which includes Defn.h) without including config.h, 
which should always be included before R's internal headers. The package 
tries to get around this by defining some entries from config.h, but not 
enough for current R versions.  It seems to work if you add -DHAVE_WCHAR_H 
to the defines.  (I did not spot how SUPPORT_MBCS got defined, but it 
seems it is.)

Incidentally, I was unable to get the package to build unless R was built 
in its source dir, and there is a mismatch between the version of the tar 
file (0.2-3) and declared in the DESCRIPTION and hence in the PACKAGES 
file (0.2).

What Duncan is trying to do here is extremely tricky, so please do not 
file bug reports against R when such things do not work for you: they are 
not deficiencies in R.

On Wed, 20 Jul 2005 [EMAIL PROTECTED] wrote:

> In what way is this a bug in R?   It looks like a bug in the package, and
> as Defn.h is not part of R's API any packge using it is `at risk' (and
> cannot be installed in a binary-only installation, or even an installed
> version of R).
>
> In particular, Defn,.h depends on config.h, and it seems you installed a
> binary version of R and used separate sources.   I would suggest building
> R from the sources, and then seeing if you can install your package into
> the build tree.
>
> mbstate_t will be defined in wchar.h, and if configure is working
> correctly that will be included by Defn.h.  (And we have heard no reports
> to the contrary.)
>
> On Tue, 19 Jul 2005 [EMAIL PROTECTED] wrote:
>
>> Full_Name: Richard Boyce
>> Version: 2.1.-1
>> OS: Debian testing/unstable
>> Submission from: (NULL) (128.95.123.29)
>>
>>
>> While building a custom package using a modified version of Duncan's
>> REventLoop with R version 2.1 (Debian package r-base, r-base-dev) and R
>> source from apt-get source 2.1.1 I get the following error:
>>
>> $ R CMD build vjREventLoop
>> * checking for file 'vjREventLoop/DESCRIPTION' ... OK
>> * preparing 'vjREventLoop':
>> * cleaning src
>> * checking whether 'INDEX' is up-to-date ... NO
>> * use '--force' to overwrite the existing 'INDEX'
>> * removing junk files
>> * building 'vjREventLoop_0.2.tar.gz'
>>
>> $ su
>> # R CMD INSTALL vjREventLoop_0.2.tar.gz
>> gcc -I/usr/lib/R/include-I/usr/src/r-base-2.1.1/src/include -fPIC  -g -O2
>> -c Reventloop.c -o Reventloop.o
>> In file included from /usr/src/r-base-2.1.1/src/include/IOStuff.h:30,
>> from Reventloop.c:8:
>> /usr/src/r-base-2.1.1/src/include/Defn.h:886: error: syntax error before
>> "mbstate_t"
>> Reventloop.c: In function `R_mainLoop':
>> Reventloop.c:112: warning: assignment from incompatible pointer type
>> Reventloop.c:156: warning: assignment from incompatible pointer type
>> make: *** [Reventloop.o] Error 1
>> ERROR: compilation failed for package 'vjREventLoop'
>> ** Removing '/usr/local/lib/R/site-library/vjREventLoop'
>> ** Restoring previous '/usr/local/lib/R/site-library/vjREventLoop'
>>
>> *Build works correctly with R-2.0.0 installed from source* with
>> $ ./configure --prefix=/usr/local --enable-R-shlib
>> $ make
>> $ su
>> # make install
>>
>> Inspection of Defn.h does not identify syntax error but I am not familiar 
>> with
>> all the details. Diff (probably not useful):
>> $ diff /usr/src/r-base-2.1.1/src/include/Defn.h
>> /opt/Downloads/r-cran/R-2.0.0/src/include/Defn.h
>>
>> 4c4
>> <  *  Copyright (C) 1998--2005  The R Development Core Team.
>> ---
>>>  *  Copyright (C) 1998--2004  The R Development Core Team.
>> 472c472
>> < LibExtern char*   R_Home; /* Root of the R tree */
>> ---
>>> extern char*  R_Home; /* Root of the R tree */
>> 499c499
>> < extern intR_Expressions   INI_as(5000);   /* options(expressions) */
>> ---
>>> extern intR_Expressions   INI_as(500);/* options(expressions) */
>> 514,515c514
>> < LibExtern char*   R_TempDir   INI_as(NULL);   /* Name of 
>> per-session
>> dir */
>> < extern char   R_StdinEnc[31]  INI_as(""); /* Encoding assumed for stdin
>> */
>> ---
>>> extern char*  R_TempDir   INI_as(NULL);   /* Name of per-session dir */
>> 530d528
>> < extern void   R_setupHistory();
>> 541,542c539
>> < LibExtern Rboolean utf8locale  INI_as(FALSE);  /* is this a UTF-8 locale? 
>> */
>> < LibExtern Rboolean mbcslocale  INI_as(FALSE);  /* is this a MBCS locale? */
>> ---
>>> extern Rboolean utf8locale  INI_as(FALSE);  /* is this a UTF-8 locale? */
>> 596a594
>>> # define duplicated   Rf_duplicated
>> 633c631
>> < # define Mbrtowc  Rf_mbrtowc
>> ---
>>> # define matchRf_match
>> 686a685
>>> int   R_ShowFile(char*, char*);
>> 799,800c798
>> < SEXP R_data_class(SEXP , Rboolean);
>> < SEXP R_data_class2(SEXP);
>> ---
>>> SEXP R_data_class(SEXP , int);
>> 864,869d861
>> < typedef enum {
>> < Rprt_adj_left = 0,
>> < Rprt_adj_right = 1,
>> < Rprt_adj_centre = 2
>> < } Rprt_adj;

Re: [Rd] WinXP GUI problem (PR#8018)

2005-07-20 Thread ligges
[EMAIL PROTECTED] wrote:

> Full_Name: Sampo Etelavuori
> Version: 2.1.1
> OS: Windows XP
> Submission from: (NULL) (130.188.8.10)
> 
> 
> After exporting for example jpeg files using the GUI the GUI gives me a 
> default
> option of saving even ordinary scripts in jpeg-format and doesn't let me 
> change
> the format at least easily.
> 
> I have also some strange stability issues on my laptop but I have no idea 
> what's
> behind them.

Can you give a reproducible example, please?

In particular tell us:

- MDI or DSI mode?
- code before clicking stuff
- What menu items have you clicked on exactly?

Uwe Ligges


> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Default arguments for setMethod() (PR#8021)

2005-07-20 Thread bgunter
Full_Name: Bert Gunter
Version: 2.1.1
OS: Windows 2000
Submission from: (NULL) (192.12.78.250)


There appears to be either a bug or documentation problem in
setMethod/setGeneric with how default arguments are handled. The setMethod Help
says:
**
Method definitions can have default expressions for arguments. If those
arguments are then missing in the call to the generic function, the default
expression in the method is used. If the method definition has no default for
the argument, then the expression (if any) supplied in the definition of the
generic function itself is used.
**
However:

> setGeneric('foo',function(x,y)standardGeneric('foo'))
[1] "foo"
> setMethod('foo','numeric',function(x,y=3)x+y)
[1] "foo"
> foo(10)
Error in foo(10) : argument "y" is missing, with no default

 BUT adding a NULL default argument in the standardGeneric fixes this:

> setGeneric('foo',function(x,y=NULL)standardGeneric('foo'))
[1] "foo"
> setMethod('foo','numeric',function(x,y=3)x+y)
[1] "foo"
> foo(10)
[1] 13

Cheers,
Bert Gunter

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] WinXP GUI problem (PR#8018)

2005-07-20 Thread ligges
Sampo Etelavuori wrote:

> Lainaus Uwe Ligges <[EMAIL PROTECTED]>:
> 
> 
>>[EMAIL PROTECTED] wrote:
>>
>>
>>>Full_Name: Sampo Etelavuori
>>>Version: 2.1.1
>>>OS: Windows XP
>>>Submission from: (NULL) (130.188.8.10)
>>>
>>>
>>>After exporting for example jpeg files using the GUI the GUI gives me a
>>
>>default
>>
>>>option of saving even ordinary scripts in jpeg-format and doesn't let
>>
>>me change
>>
>>>the format at least easily.
>>>
>>>I have also some strange stability issues on my laptop but I have no
>>
>>idea what's
>>
>>>behind them.
>>
>>Can you give a reproducible example, please?
>>
>>In particular tell us:
>>
>>- MDI or DSI mode?
> 
> 
> The default mode. Not sure which one it is.


It is MDI.


> 
>>- code before clicking stuff
> 
> 
> It happens even after just using the command "plot(1:10)" after starting 
> the program. I didn't notice the bug while still using v. 2.1.0.
> 
> 
>>- What menu items have you clicked on exactly?
> 
> 
> After I have the active plot, clicking File-Save As-Jpeg-100% quality and
> then creating a new script and then trying to save it.
> 
> But I might add that only the extension is wrong (.jpeg instead of .R) not 
> the actual format.

Confirmed for R-2.1.1, WinNT4.0SP6.

Uwe Ligges

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] WinXP GUI problem (PR#8018)

2005-07-20 Thread Prof Brian Ripley
Yes, the author of that part of the editor code forgot a call to
setuserfilter, although he has one for opening scripts.

I am about to add one.


On Wed, 20 Jul 2005 [EMAIL PROTECTED] wrote:

> Sampo Etelavuori wrote:
>
>> Lainaus Uwe Ligges <[EMAIL PROTECTED]>:
>>
>>
>>> [EMAIL PROTECTED] wrote:
>>>
>>>
 Full_Name: Sampo Etelavuori
 Version: 2.1.1
 OS: Windows XP
 Submission from: (NULL) (130.188.8.10)


 After exporting for example jpeg files using the GUI the GUI gives me a
>>>
>>> default
>>>
 option of saving even ordinary scripts in jpeg-format and doesn't let
>>>
>>> me change
>>>
 the format at least easily.

 I have also some strange stability issues on my laptop but I have no
>>>
>>> idea what's
>>>
 behind them.
>>>
>>> Can you give a reproducible example, please?
>>>
>>> In particular tell us:
>>>
>>> - MDI or DSI mode?
>>
>>
>> The default mode. Not sure which one it is.
>
>
> It is MDI.
>
>
>>
>>> - code before clicking stuff
>>
>>
>> It happens even after just using the command "plot(1:10)" after starting
>> the program. I didn't notice the bug while still using v. 2.1.0.
>>
>>
>>> - What menu items have you clicked on exactly?
>>
>>
>> After I have the active plot, clicking File-Save As-Jpeg-100% quality and
>> then creating a new script and then trying to save it.
>>
>> But I might add that only the extension is wrong (.jpeg instead of .R) not
>> the actual format.
>
> Confirmed for R-2.1.1, WinNT4.0SP6.
>
> Uwe Ligges
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Internationalization of the Rcmdr package

2005-07-20 Thread John Fox
Dear r-devel list members,

I've prepared a version of the Rcmdr package that uses the new tools for
internationalization and localization in R 2.1.x. For the present, this is
the development version of the Rcmdr package (1.1-0), available at
. There is
currently a French translation provided with the package, courtesy of
Philippe Grosjean. 

As far as I can tell so far, translations appear to work well, though the
tests have been limited since French uses the same character set as English.
Please let me know if you'd like to provide a translation into another
language. I'm especially interested in a language or languages that use
different character sets.

One problem that I've encountered is that the text for buttons (e.g.,
"Open", "Cancel", "Yes", "No") in the standard Tk dialogs (e.g.,
tk_getOpenFile and tk_messageBox via tkgetOpenFile() and tkmessageBox() in
the tcltk package) is not translated, at least under Windows XP, where I've
tested. I've seen translated buttons in Tk dialogs under Linux, so perhaps
this is a Windows-specific problem.

Regards,
 John


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] S4 Dispatching

2005-07-20 Thread John Chambers
Paul Roebuck wrote:
> Is it possible for S4 to (continue) dispatch to a class
> created during dispatching? The code below doesn't work;
> is this not possible or have I ommitted something?

"doesn't work"?  This is not helpful.  Please show what you got and what 
you expected.  The result below is what I would expect (& get) from your 
code.

R> onthefly("testing")
generic onthefly
onthefly (character)
generic onthefly
onthefly (mydata)
List of 1
  $ name: chr "mydata"
  - attr(*, "class")= chr "mydata"

Since you used an undefined class "mydata" you can't expect very much 
else to work with these objects.  You did not in fact "create" the 
class, you just assigned a class attribute to an object corresponding to 
an undefined class.  There is a warning message to that effect from the 
second setMethod() call.


> 
> Concept was to create a SEXP with R_AllocatePtr, give it
> a class attribute, and continue dispatch. Example code
> below omits multiple parameters that can be different types.
> Essentially, any parameter would be converted to an
> internal type "class" and the final dispatch would be
> passing EXTPTRSXP objects.
> 
> 
> library(methods)
> 
> setGeneric("onthefly",
>function(mydata) {
> cat("generic", match.call()[[1]], "\n")
> standardGeneric("onthefly")
> })
> 
> setMethod("onthefly",
>   signature(mydata = "character"),
>   function(mydata) {
> cat(match.call()[[1]],
> "(character)\n")
> 
> # Simulating EXTPTRSXP
> mydata <- list(name = "mydata")
> class(mydata) <- "mydata"
> 
> callGeneric(mydata)
> })
> 
> setMethod("onthefly",
>   signature(mydata = "mydata"),
>   function(mydata) {
> cat(match.call()[[1]],
> "(mydata)\n")
> 
> str(mydata)
> })
> 
> 
> 
> 
>>version
> 
>  _
> platform powerpc-apple-darwin7.9.0
> arch powerpc
> os   darwin7.9.0
> system   powerpc, darwin7.9.0
> status
> major2
> minor1.1
> year 2005
> month06
> day  20
> language R
> 
> --
> SIGSIG -- signature too long (core dumped)
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Default arguments for setMethod() (PR#8021)

2005-07-20 Thread John Chambers
Quite right.  There is code in the evaluator that copies default values 
from the method into the promise for a missing argument, when the method 
is being evalutated.

The catch seems to be that there is no promise unless SOME default was 
included for the argument in the generic.

So either we need to adjust the generic accordingly, perhaps when the 
setMethod() with a default is done (this could be tricky with multiple 
packages having methods for the same generic), or else admit the 
ugliness in the documentation.

Thanks.

[EMAIL PROTECTED] wrote:

> Full_Name: Bert Gunter
> Version: 2.1.1
> OS: Windows 2000
> Submission from: (NULL) (192.12.78.250)
> 
> 
> There appears to be either a bug or documentation problem in
> setMethod/setGeneric with how default arguments are handled. The setMethod 
> Help
> says:
> **
> Method definitions can have default expressions for arguments. If those
> arguments are then missing in the call to the generic function, the default
> expression in the method is used. If the method definition has no default for
> the argument, then the expression (if any) supplied in the definition of the
> generic function itself is used.
> **
> However:
> 
> 
>>setGeneric('foo',function(x,y)standardGeneric('foo'))
> 
> [1] "foo"
> 
>>setMethod('foo','numeric',function(x,y=3)x+y)
> 
> [1] "foo"
> 
>>foo(10)
> 
> Error in foo(10) : argument "y" is missing, with no default
> 
>  BUT adding a NULL default argument in the standardGeneric fixes this:
> 
> 
>>setGeneric('foo',function(x,y=NULL)standardGeneric('foo'))
> 
> [1] "foo"
> 
>>setMethod('foo','numeric',function(x,y=3)x+y)
> 
> [1] "foo"
> 
>>foo(10)
> 
> [1] 13
> 
> Cheers,
> Bert Gunter
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] mac os x crashes with bioconductor microarray code (PR#8013)

2005-07-20 Thread Simon Urbanek
On Jul 19, 2005, at 12:34 AM, [EMAIL PROTECTED] wrote:

> R(1763) malloc: *** vm_allocate(size=346857472) failed (error code=3)
> R(1763) malloc: *** error: can't allocate region

As the error says, you're obviously running out of contiguous wired  
memory (RAM).

> Any ideas? My computer has 2gb of RAM and 100 gb free. I would  
> think that analyzing 42 microarrays would not be too difficult.

You didn't tell us anything about the size of the data - and it seems  
to be of considerable size, because it fails on allocating ca. 350MB  
bytes at once. Whether what you do is difficult or not, that I don't  
know, but obviously you don't have enough memory for what you're  
trying to do. Basically that means you should reconsider your  
approach. Once you provide more information you may want to ask  
Bioconductor users about this issue, but it's definitely not a bug in R.

Cheers,
Simon

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel