[Rd] Minor "bug" in source()

2005-07-19 Thread Henrik Bengtsson
For R v2.1.1 patched and R v2.2.0 devel:

Calling source(file, chdir=TRUE) with is.character(file) != TRUE, that 
is, with 'file' as a connection, will generate an error. Example:

 > file <- textConnection("cat('Hello world\n')")
 > source(file, chdir=TRUE)
Error in source(file, chdir = TRUE) : Object "ofile" not found

Of course, it does not make sense to change working directory, but 
quietly ignoring 'chdir' is better, I think.

This is due to a simple coding mistake in source() [sorry, 56k modem
=> no R source => no diff]:


 if (is.character(file)) {
 ofile <- file
 if (capabilities("iconv")) {
 if (identical(encoding, "unknown")) {
 
 }
 Ne <- length(exprs <- .Internal(parse(file, n = -1, NULL,
 "?")))
 if (verbose)
 cat("--> parsed", Ne, "expressions; now eval(.)ing them:\n")
 if (Ne == 0)
 return(invisible())
 if (chdir && is.character(ofile)) {<=== HERE
 isURL <- length(grep("^(ftp|http|file)://", ofile)) >
 0
 if (!isURL && (path <- dirname(ofile)) != ".") {
 owd <- getwd()
 on.exit(setwd(owd), add = TRUE)
 setwd(path)
 }
 }


I suggest to either i) do 'ofile <- file' before the first if-clause 
above, or better ii) move the last if-clause inside the first one (and 
remove " && is.character(ofile)").

Best

Henrik

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


Re: [Rd] Minor "bug" in source()

2005-07-19 Thread Prof Brian Ripley
I think at least a warning is appropriate here (and also for a URL), so 
have modified the code to have one in each case.

There is a reason why the chdir code is later, after the parsing, for it 
was thought more important to get an error from parsing than from failing 
to chdir.

On Tue, 19 Jul 2005, Henrik Bengtsson wrote:

> For R v2.1.1 patched and R v2.2.0 devel:
>
> Calling source(file, chdir=TRUE) with is.character(file) != TRUE, that
> is, with 'file' as a connection, will generate an error. Example:
>
> > file <- textConnection("cat('Hello world\n')")
> > source(file, chdir=TRUE)
> Error in source(file, chdir = TRUE) : Object "ofile" not found
>
> Of course, it does not make sense to change working directory, but
> quietly ignoring 'chdir' is better, I think.
>
> This is due to a simple coding mistake in source() [sorry, 56k modem
> => no R source => no diff]:
>
> 
> if (is.character(file)) {
> ofile <- file
> if (capabilities("iconv")) {
> if (identical(encoding, "unknown")) {
> 
> }
> Ne <- length(exprs <- .Internal(parse(file, n = -1, NULL,
> "?")))
> if (verbose)
> cat("--> parsed", Ne, "expressions; now eval(.)ing them:\n")
> if (Ne == 0)
> return(invisible())
> if (chdir && is.character(ofile)) {<=== HERE
> isURL <- length(grep("^(ftp|http|file)://", ofile)) >
> 0
> if (!isURL && (path <- dirname(ofile)) != ".") {
> owd <- getwd()
> on.exit(setwd(owd), add = TRUE)
> setwd(path)
> }
> }
> 
>
> I suggest to either i) do 'ofile <- file' before the first if-clause
> above, or better ii) move the last if-clause inside the first one (and
> remove " && is.character(ofile)").
>
> Best
>
> Henrik
>
> __
> 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


Re: [Rd] Computer algebra in R - would that be an idea??

2005-07-19 Thread stefano iacus

On 17/lug/05, at 20:55, Ayal Pinkus wrote:

>
>
> Hi,
>
>
>>
>> R builds fine under Windows (though you need to pay attention to
>> the details
>> which are in the (binary) distribution in the pdf files, in
>> particular: `R
>> Installation and Administration Manual', a html copy is also on the
>> website;
>> and the README* and INSTALL files in src/gnuwin32/ ).  These
>> details look
>> tedious at first, and you may have to install a few things, but it
>> keeps the
>> sources closely tied between Windoze and the Unixish operating
>> systems on
>> which many of us prefer to develop.
>>
>>
>
> Ok. Unfortunately I work on a Mac OS X at home (I have access to
> Windows, MS DevStudio
> at work but want to keep work and hobby separate). I do work with
> Xcode (have to
> delve deeper in to Cocoa still though). Can integration also be done
> on Mac OS X?

As Peter said there few r-core members working on OS X me and Simon  
are in charge for the GUI at the moment, but Luke T. and Thomas L.  
have also mac.
I'll be happy to provide any help I can but this summer I'll have  
difficulties with internet connections.
There is no project file for R itself but there is one for R.app. R  
builds with standard ./configure, make etc.
In R.app you'll find a Cocoa class called REngine which you can  
probably look at.
stefano



> If I understood correctly you go the COM route for integration on
> Windows?
>
> CrystalSpace is a 3d engine that has a COM simulation layer for Unix-
> style platforms
> I think (last time I looked was a few years back). It would
> essentially be a thin layer
> to implementations of abstract classes.
>
> I did download R for Mac OS X. It is quite a nice package! I wish I
> had looked at it earlier.
> You did a very good job on the user interface.
>
>
>
>> Allow me to add that this sounds very exciting.
>>
>
> I agree!
>
> I am working on a Java port at the moment. I will try to make some
> time later this evening
> or perhaps somewhere this week.
>
> Ayal
>
> __
> 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] segfault with grid and null unit (PR#8014)

2005-07-19 Thread jp-www
Full_Name: Jonathan Paisley
Version: 2.1.1
OS: Mac OS X 10.4.2
Submission from: (NULL) (81.178.107.67)


I was following an example from library/grid/doc/grid.pdf ("Introduction to
grid") and had the following code, where I'd mis-typed 1,3 instead of 1,2 as the
first arguments to grid.layout.

Sourcing this code causes the R GUI to crash. I've enclosed a partial backtrace
from the crash below.

==
require(grid)

sometext = "hello there\nthis is a \ntest!"

pushViewport(
viewport(
layout=grid.layout(1,3,
widths=unit.c(
unit(1,"strwidth",sometext) +
unit(2,"cm"),
unit(1,"null")
)
)
)
)
==

Date/Time:  2005-07-19 11:35:30.950 +0100
OS Version: 10.4.2 (Build 8C46)
Report Version: 3

Command: R
Path:/Volumes/George/MyApplications/R.app/Contents/MacOS/R
Parent:  WindowServer [146]

Version: 1.12 (1622)

PID:10493
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:  KERN_INVALID_ADDRESS (0x0001) at 0x6801

Thread 0 Crashed:
0   libR.dylib  0x00303d1c Rf_isObject + 0 (util.c:623)
1   grid.so 0x060c6240 pureNullUnit + 40 (unit.c:270)
2   grid.so 0x060c6284 pureNullUnit + 108 (unit.c:273)
3   grid.so 0x060c3894 findRelWidths + 60 (layout.c:69)
4   grid.so 0x060c484c calcViewportLayout + 172
(layout.c:464)
5   grid.so 0x060ca888 calcViewportTransform + 1296
(viewport.c:356)
6   grid.so 0x060be0a0 doSetViewport + 256 (grid.c:200)
7   grid.so 0x060be5ac L_setviewport + 76 (grid.c:311)
8   libR.dylib  0x00249318 do_dotcall + 652 (dotcode.c:770)
9   libR.dylib  0x0024cc7c do_dotcallgr + 80 (dotcode.c:1450)
10  libR.dylib  0x00263b24 Rf_eval + 1536 (eval.c:405)
11  libR.dylib  0x00265b1c do_set + 224 (eval.c:1309)

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


[Rd] Statistics (PR#8015)

2005-07-19 Thread wujianyun11
Full_Name: Wu,Jianyun
Version: 2.1.1
OS: 
Submission from: (NULL) (139.80.123.40)


When i install the software,it appears a language selection box, which contain
chinese and english. Then i selected english, but after it was installed, the R
is running in Chinese character with some characters are wrong. I dont know what
happens

looking forward to your reply

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


Re: [Rd] Statistics (PR#8015)

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

> Full_Name: Wu,Jianyun
> Version: 2.1.1
> OS: 
> Submission from: (NULL) (139.80.123.40)
> 
> 
> When i install the software,it appears a language selection box, which contain

This is not a bug! Before submitting a bug report. Please read what a 
bug is. If you are unsure or have a question, please ask on R-help!

You have not specified your Operating System which is essential for bug 
reports (although we know it is Windows, others don't have any selection 
box).


The selection box aims at setting the language for the installation 
procedure, not for running R.


> chinese and english. Then i selected english, but after it was installed, the 
> R
> is running in Chinese character with some characters are wrong. I dont know 
> what
> happens

You can set the environment variable
LANGUAGE=en

Please look into the archives of the R-help list. This has been 
dicsussed there before.


Uwe Ligges


> looking forward to your reply
> 
> __
> 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] translation with Rd.sty, Sweave and tex4th (PR#8016)

2005-07-19 Thread paulojus
Full_Name: Paulo Ribeiro
Version: 2.1-1
OS: Debian Linux
Submission from: (NULL) (200.103.144.24)


I'm using Sweave with tex4th to generate xhtml documents
from documents created using Sweave which include \usepackage{Rd}
in the preamble

However there seems to be a problem with \Link defined in
Rd.sty, since this is also defined in tex4ht.sty

My workaround was to replace the lines with
\newcommand{\Link} by \providecommand{\Link}
in Rd.sty

I'm therefore wondering whether this is the best solution, if there is any
other
and, if so, whether this could be modified in the original Rd.sty shipped with
R.

A possible inconvenient of the suggested above
is that \providecommand seems to be specific to
LaTeX and apparently does not work with TeX.
Another possibility, as suggested by Kurt, would be "emulate" namespaces
with something of the type [EMAIL PROTECTED] 

with best regards

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


Re: [Rd] translation with Rd.sty, Sweave and tex4th (PR#8016)

2005-07-19 Thread ripley
Why not report this as a bug *in tex4th* that conflicts with R?  LaTeX has 
no namespaces, and unfortunately name conflicts are common.  Doing as you 
suggest and allowing one package to clobber another is much worse.

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

> Full_Name: Paulo Ribeiro
> Version: 2.1-1
> OS: Debian Linux
> Submission from: (NULL) (200.103.144.24)
>
>
> I'm using Sweave with tex4th to generate xhtml documents
> from documents created using Sweave which include \usepackage{Rd}
> in the preamble
>
> However there seems to be a problem with \Link defined in
> Rd.sty, since this is also defined in tex4ht.sty
>
> My workaround was to replace the lines with
> \newcommand{\Link} by \providecommand{\Link}
> in Rd.sty
>
> I'm therefore wondering whether this is the best solution, if there is any
> other
> and, if so, whether this could be modified in the original Rd.sty shipped with
> R.
>
> A possible inconvenient of the suggested above
> is that \providecommand seems to be specific to
> LaTeX and apparently does not work with TeX.

Nor does \newcommand.  It is part of LaTeX's extra care in finding 
conflicting definitions.

> Another possibility, as suggested by Kurt, would be "emulate" namespaces
> with something of the type [EMAIL PROTECTED]

Really a general-purpose package like tex4th should be doing that, not R. 
As many R installations have lots of prebuilt latex files installed, 
changing R's macros can only be done for 3.0.0.

-- 
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] extracting and manipulating components from nlme and gnls objects

2005-07-19 Thread Nicholas Lewin-Koh
Hello,
I am writing a set of functions to do prediction and calibration
intervals 
for at least the subset of selfstarting models if not some more general
ones.

I need to be able to extract the varFunction from a fit object
and evaluate it at a predicted point. Are there any examples around?

Also in a self start model, say SSlogis, how would I get the gradient
at a point?

Thanks
Nicholas

PS I am sure I will have more questions

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


Re: [Rd] extracting and manipulating components from nlme and gnls objects

2005-07-19 Thread Douglas Bates
On 7/19/05, Nicholas Lewin-Koh <[EMAIL PROTECTED]> wrote:
> Hello,
> I am writing a set of functions to do prediction and calibration
> intervals
> for at least the subset of selfstarting models if not some more general
> ones.
> 
> I need to be able to extract the varFunction from a fit object
> and evaluate it at a predicted point. Are there any examples around?
> 
> Also in a self start model, say SSlogis, how would I get the gradient
> at a point?

I think that the output of 

example(SSlogis)

should answer that question for you.

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


[Rd] build of REventLoop package crashes with 2.1 due tosyntax error in Defn.h (PR#8017)

2005-07-19 Thread boycer
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(a,b,c)
< #define wcstombs(a,b,c) Rwcstombs(a,b,c)
< size_t Rmbrtowc(wchar_t *wc, const char *s);
< size_t Rwcrtomb(char *s, const wchar_t wc);
< size_t Rmbstowcs(wchar_t *wc, const char *s, size_t n);
< size_t Rwcstombs(char *s, const wchar_t *wc, size_t n);
< #endif
<
< /* used in relop.c and sort.c */
< #if defined(Win32) && defined(SUPPORT_UTF8)
< #define STRCOLL Rstrcoll
< #else
<
< #ifdef HAVE_STRCOLL
< #define STRCOLL strcoll
< #else
< #define STRCOLL strcmp
< #endif
<
< #endif
<
< /* Localization */
<
< #ifdef ENABLE_NLS
< #include 
< #ifdef Win32
< #define _(String) libintl_gettext (String)
< #undef gettext /* needed for graphapp */
< #else
< #define _(String) gettext (String)
< #endif
< #define gettext_noop(String) String
< #define N_(String) gettext_noop (String)
< #else /* not NLS */
< #define _(String) (String)
< #define N_(String) String
< #endif
<
---
> char *EncodeString(SEXP, int,

Re: [Rd] extracting and manipulating components from nlme and gnls objects

2005-07-19 Thread Nicholas Lewin-Koh
Hi,
Yes, I looked more carefully at the code and realized the parameters
have to be named
and then the gradient is returned so that
SSlogis(3.4,4,5,6) does not return the gradient as an attribute but
Asym<-4
xmid<-5
scal<-6
SSlogis(3.4,Asym,xmid,scal)

does.

However what I am finding more vexing is if I fit a model, say

fit<-gnls(resp~SSlogis(covar,Asym,xmid,scal), data=foo,
weights=varPower())

and I want to evaluate the arbitrary variance function at a new x, x0
then how do i get the variance function from the fit object and evaluate
it
at f(x0,..)?

So far I can predict at x0 using predict(fit, newdata=list(covar=x0)) to
get the fitted value
but how to I plug that in to the varStruct stored in fit$modelStruct?

Thanks
Nicholas
On Tue, 19 Jul 2005 11:48:18 -0500, "Douglas Bates" <[EMAIL PROTECTED]>
said:
> On 7/19/05, Nicholas Lewin-Koh <[EMAIL PROTECTED]> wrote:
> > Hello,
> > I am writing a set of functions to do prediction and calibration
> > intervals
> > for at least the subset of selfstarting models if not some more general
> > ones.
> > 
> > I need to be able to extract the varFunction from a fit object
> > and evaluate it at a predicted point. Are there any examples around?
> > 
> > Also in a self start model, say SSlogis, how would I get the gradient
> > at a point?
> 
> I think that the output of 
> 
> example(SSlogis)
> 
> should answer that question for you.

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


Re: [Rd] segfault with grid and null unit (PR#8014)

2005-07-19 Thread Simon Urbanek
On Jul 19, 2005, at 6:39 AM, [EMAIL PROTECTED] wrote:

> Sourcing this code causes the R GUI to crash. I've enclosed a  
> partial backtrace
> from the crash below.

I can confirm that this crashes both on OS X (current R-devel) and  
Linux (2.1.1). The detailed stack trace (with debug symbols) from OS  
X follows.

However, I can't find any documentation on "null" units (?unit  
doesn't mention them), so I wonder whether this is just a missing  
sanity check or something more profound ...

#0  Rf_isObject (s=0x6801) at ../../../../R-devel/src/main/util.c: 
616
#1  0x003060e4 in Rf_inherits (s=0x6801, name=0x966ad80  
"unit.arithmetic") at ../../../../R-devel/src/main/util.c:624
#2  0x096651b8 in pureNullUnit (unit=0x6801, index=0,  
dd=0x113eff0) at ../../../../../../R-devel/src/library/grid/src/ 
unit.c:270
#3  0x096651fc in pureNullUnit (unit=0x10ff78e8, index=2,  
dd=0x113eff0) at ../../../../../../R-devel/src/library/grid/src/ 
unit.c:273
#4  0x09662768 in findRelWidths (layout=0x108d7528,  
relativeWidths=0x11b0b4f8, dd=0x113eff0) at ../../../../../../R-devel/ 
src/library/grid/src/layout.c:70
#5  0x09663720 in calcViewportLayout (viewport=0x10bfad60,  
parentWidthCM=12.699, parentHeightCM=12.699,  
parentContext={xscalemin = 0, xscalemax = 1, yscalemin = 0, yscalemax  
= 1}, parentgc=0xbfff76f0, dd=0x113eff0) at ../../../../../../R-devel/ 
src/library/grid/src/layout.c:463
#6  0x09669888 in calcViewportTransform (vp=0x10bfad60,  
parent=0x10c6af38, incremental=3221190720, dd=0x113eff0)  
at ../../../../../../R-devel/src/library/grid/src/viewport.c:351
#7  0x0965cefc in doSetViewport (vp=0x10bfad60, topLevelVP=157724032,  
pushing=281456440, dd=0x113eff0) at ../../../../../../R-devel/src/ 
library/grid/src/grid.c:185
#8  0x0965d40c in L_setviewport (vp=0x10bfad60, hasParent=0x10d4da68)  
at ../../../../../../R-devel/src/library/grid/src/grid.c:302
#9  0x0024a0b0 in do_dotcall (call=0x119008d8, op=0x966ad80,  
args=0x18681b0, env=0x80808080) at ../../../../R-devel/src/main/ 
dotcode.c:788
#10 0x0024da14 in do_dotcallgr (call=0x119008d8, op=0x18c5794,  
args=0x11902244, env=0x11900ccc) at ../../../../R-devel/src/main/ 
dotcode.c:1468
#11 0x00264964 in Rf_eval (e=0x119008d8, rho=0x11900ccc)  
at ../../../../R-devel/src/main/eval.c:405

Cheers,
Simon


> ==
> require(grid)
>
> sometext = "hello there\nthis is a \ntest!"
>
> pushViewport(
> viewport(
> layout=grid.layout(1,3,
> widths=unit.c(
> unit(1,"strwidth",sometext) +
> unit(2,"cm"),
> unit(1,"null")
> )
> )
> )
> )
> ==
>
> Date/Time:  2005-07-19 11:35:30.950 +0100
> OS Version: 10.4.2 (Build 8C46)
> Report Version: 3
>
> Command: R
> Path:/Volumes/George/MyApplications/R.app/Contents/MacOS/R
> Parent:  WindowServer [146]
>
> Version: 1.12 (1622)
>
> PID:10493
> Thread: 0
>
> Exception:  EXC_BAD_ACCESS (0x0001)
> Codes:  KERN_INVALID_ADDRESS (0x0001) at 0x6801
>
> Thread 0 Crashed:
> 0   libR.dylib   0x00303d1c Rf_isObject + 0 (util.c: 
> 623)
> 1   grid.so  0x060c6240 pureNullUnit + 40  
> (unit.c:270)
> 2   grid.so  0x060c6284 pureNullUnit + 108  
> (unit.c:273)
> 3   grid.so  0x060c3894 findRelWidths + 60  
> (layout.c:69)
> 4   grid.so  0x060c484c calcViewportLayout + 172
> (layout.c:464)
> 5   grid.so  0x060ca888 calcViewportTransform +  
> 1296
> (viewport.c:356)
> 6   grid.so  0x060be0a0 doSetViewport + 256  
> (grid.c:200)
> 7   grid.so  0x060be5ac L_setviewport + 76  
> (grid.c:311)
> 8   libR.dylib   0x00249318 do_dotcall + 652  
> (dotcode.c:770)
> 9   libR.dylib   0x0024cc7c do_dotcallgr + 80  
> (dotcode.c:1450)
> 10  libR.dylib   0x00263b24 Rf_eval + 1536 (eval.c: 
> 405)
> 11  libR.dylib   0x00265b1c do_set + 224 (eval.c:1309)
>
> __
> 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] Problem building R

2005-07-19 Thread Jeff Gentry
I initially thought this only was the case for me on R-devel, but also
just tested it on the current R-patched and R-2.1.1 (so perhaps this more
belongs on R-help, but ...).

I'm having an odd error with the makefiles in src/library/XXX while
building R.  When it tries to create the 'po' directory, the Makefile
specifies:

@if test -d $(srcdir)/inst/po; then \
  $(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)/po; \
  cp -pr  $(srcdir)/inst/po/* $(top_builddir)/library/$(pkg)/po; \
  find "$(top_builddir)/library/$(pkg)/po" -name .svn -type d
-prune \
   -exec rm -rf \{\} \; 2>/dev/null; \
fi

However, mine dies with the error:
make[3]: Entering directory
`/mnt/disk2/home/jgentry/R-devel/src/library/base'
building package 'base'
all.R is unchanged
make[3]: *** [all] Error 127
make[3]: Leaving directory
`/mnt/disk2/home/jgentry/R-devel/src/library/base'
make[2]: *** [R] Error 1

If I put an echo in between the find and the 'fi', it will no longer throw
an error and go to the next package (where it will fail as I didn't put
the echo in there, presumably I could go and put an echo in all of the
base packages and my install would work though).

Has anyone seen this?

FWIW I'm using an AMD x86_64 machine, running RHEL WS 3.2

Thanks

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


Re: [Rd] Problem building R

2005-07-19 Thread Peter Dalgaard
Jeff Gentry <[EMAIL PROTECTED]> writes:

> I initially thought this only was the case for me on R-devel, but also
> just tested it on the current R-patched and R-2.1.1 (so perhaps this more
> belongs on R-help, but ...).
> 
> I'm having an odd error with the makefiles in src/library/XXX while
> building R.  When it tries to create the 'po' directory, the Makefile
> specifies:
> 
>   @if test -d $(srcdir)/inst/po; then \
> $(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)/po; \
> cp -pr  $(srcdir)/inst/po/* $(top_builddir)/library/$(pkg)/po; \
> find "$(top_builddir)/library/$(pkg)/po" -name .svn -type d
> -prune \
>  -exec rm -rf \{\} \; 2>/dev/null; \
>   fi
> 
> However, mine dies with the error:
> make[3]: Entering directory
> `/mnt/disk2/home/jgentry/R-devel/src/library/base'
> building package 'base'
> all.R is unchanged
> make[3]: *** [all] Error 127
> make[3]: Leaving directory
> `/mnt/disk2/home/jgentry/R-devel/src/library/base'
> make[2]: *** [R] Error 1
> 
> If I put an echo in between the find and the 'fi', it will no longer throw
> an error and go to the next package (where it will fail as I didn't put
> the echo in there, presumably I could go and put an echo in all of the
> base packages and my install would work though).
> 
> Has anyone seen this?
> 
> FWIW I'm using an AMD x86_64 machine, running RHEL WS 3.2
> 
> Thanks

Hi Jeff,

Hmm, it's not happening for me on FC4/x86_64.

You seen to be building in the source directory. Could you try with a
separate builddir? 

Perhaps get rid of the @ in @if and the 2>/dev/null so we get to see a
bit more of the the error messages.

What you're seeing is consistent with an error return from find, I
think. So perhaps look at the permission in the srcdir? Just a
conjecture. 

-- 
   O__   Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

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


[Rd] S4 Dispatching

2005-07-19 Thread Paul Roebuck
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?

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


[Rd] R_AllocatePtr

2005-07-19 Thread Paul Roebuck
Had been looking into Luke Tierney's R_AllocatePtr() and
was left with a question about exactly when does R reclaim
heap memory. Implication of 'simpleref.nw' is that one can
allocate C data on the R heap, and as long as pointer object
is alive, the data and pointer will remain valid. But it
calls allocString() which is implemented using R_alloc().

'Writing R Extensions" says R will reclaim memory allocated
using R_alloc() at the end of the .Call().

Was the intent that its invocation be restricted to within
a .Call()? Doesn't sound as though it could be used to return
an SEXP from a .Call() with its data intact.

--
SIGSIG -- signature too long (core dumped)

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


Re: [Rd] R_AllocatePtr

2005-07-19 Thread Douglas Bates
On 7/19/05, Paul Roebuck <[EMAIL PROTECTED]> wrote:
> Had been looking into Luke Tierney's R_AllocatePtr() and
> was left with a question about exactly when does R reclaim
> heap memory. Implication of 'simpleref.nw' is that one can
> allocate C data on the R heap, and as long as pointer object
> is alive, the data and pointer will remain valid. But it
> calls allocString() which is implemented using R_alloc().
> 
> 'Writing R Extensions" says R will reclaim memory allocated
> using R_alloc() at the end of the .Call().
> 
> Was the intent that its invocation be restricted to within
> a .Call()? Doesn't sound as though it could be used to return
> an SEXP from a .Call() with its data intact.

Sounds like you may want an R external pointer object, which is also
documented in simpleref.nw

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


Re: [Rd] R_AllocatePtr

2005-07-19 Thread Thomas Lumley
On Tue, 19 Jul 2005, Paul Roebuck wrote:

> Had been looking into Luke Tierney's R_AllocatePtr() and
> was left with a question about exactly when does R reclaim
> heap memory. Implication of 'simpleref.nw' is that one can
> allocate C data on the R heap, and as long as pointer object
> is alive, the data and pointer will remain valid. But it
> calls allocString() which is implemented using R_alloc().

Um, no.  allocString is
SEXP allocString(int length)
{
 return allocVector(CHARSXP, length);
}

In fact the reverse is true, R_alloc is implemented using allocString.

-thomas


Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

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


Re: [Rd] segfault with grid and null unit (PR#8014)

2005-07-19 Thread jp-www

On 19 Jul 2005, at 23:49, paul murrell wrote:
>
> The issue is that you have specified a layout with three columns,  
> but only two
> column widths.  What should happen is that the widths should be  
> recycled, but
> this was not working for non-trivial units (as in your example).  I  
> have fixed
> this for R 2.2.0.  I have also added a mention of "null" units to ? 
> unit, plus a
> link to the existing mention in ?grid.layout

Thanks for the info, and also for the recent documentation on the  
grid package, which I have been devouring today.

I stumbled across that bug when I was copying (by hand) the "Adding  
lattice to grid" example from "grid.pdf" and mis-typed 3 instead of 2.

Jonathan

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


[Rd] Problems in rgl on MacOS X

2005-07-19 Thread Bill Northcott
I have recently been trying to build rgl on MacOS X 10.4 using  
R-2.1.1 with gcc-4.0 5026 and gfortran.

The R binary I built without problems and it includes libpng and Tcl/ 
Tk on X11.  Rcmdr works correctly.

The rgl build produces a large number of warnings like:
g++ -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/ 
include -I/System/Library/Frameworks/OpenGL.framework/Headers  -I/usr/ 
X11R6/include -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/usr/ 
local/include  -Wall -pedantic -fno-exceptions -fno-rtti -fno-common   
-g -O2 -c fps.cpp -o fps.o
types.h:76: warning: 'class DestroyHandler' has virtual functions but  
non-virtual destructor
gui.h:55: warning: 'class gui::WindowImpl' has virtual functions but  
non-virtual destructor
gui.h:89: warning: 'class gui::GUIFactory' has virtual functions but  
non-virtual destructor
pixmap.h:39: warning: 'class PixmapFormat' has virtual functions but  
non-virtual destructor

More seriously it breaks in scene.cpp thus:
g++ -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/ 
include -I/System/Library/Frameworks/OpenGL.framework/Headers  -I/usr/ 
X11R6/include -DDarwin -DNO_GL_PREFIX -I/usr/X11R6/include -I/usr/ 
local/include  -Wall -pedantic -fno-exceptions -fno-rtti -fno-common   
-g -O2 -c scene.cpp -o scene.o
types.h:76: warning: 'class DestroyHandler' has virtual functions but  
non-virtual destructor
gui.h:55: warning: 'class gui::WindowImpl' has virtual functions but  
non-virtual destructor
gui.h:89: warning: 'class gui::GUIFactory' has virtual functions but  
non-virtual destructor
pixmap.h:39: warning: 'class PixmapFormat' has virtual functions but  
non-virtual destructor
scene.cpp: In member function 'void Texture::beginUse(RenderContext*)':
scene.cpp:1994: error: invalid conversion from 'int*' to 'GLint*'
make: *** [scene.o] Error 1
ERROR: compilation failed for package 'rgl'

The compilers complaint appears to be legitimate in gl.h there is:
..
typedef short GLshort;
typedef long GLint;
typedef long GLsizei;

extern void glGetHistogramParameteriv (GLenum target, GLenum pname,  
GLint *params);
extern void glGetIntegerv (GLenum pname, GLint *params);
extern void glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
.

and in scene.cpp the relevant lines read:
..
 unsigned int maxSize;
 glGetIntegerv(GL_MAX_TEXTURE_SIZE, (int*) &maxSize);
...
which seems to give the compiler due cause to barf given the header.

I got it to build by changing the code to:
 GLint maxSize;
 glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &maxSize);
but this generates warnings about signed and unsigned further down  
scene.cpp.  The resulting code works but  it is clearly not right.

I can't find an email address for the maintainer and his web site  
seems to be off the air just now.

Bill Northcott

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


[Rd] Regexp update in R-devel

2005-07-19 Thread Prof Brian Ripley
Following the report of Henrik Bengtsson which was traced by Duncan 
Murdoch to a bug in the regexp code from glibc-2.3.3 in R, I have updated 
the code in R-devel to -2.3.5.  This had that bug fixed and about 700 
other changes, most of which seem to be bug fixes.

My tests on Linux (including of all CRAN packages) have detected no 
differences (but then I was not able to reproduce Henrik's problem on 
Linux, only on Windows).  If anyone finds a difference that they think is 
not a bug fix please let me know.

There are also quite a few new optimizations, especially in UTF-8 locales.

It seems somewhat clear that the codes available for multi-byte character 
set regexps are not yet mature.  You might want to remember that if you 
use a GNU/Linux system which is not bang up-to-date (many are older than 
even glinc-2.3.3).

-- 
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] WinXP GUI problem (PR#8018)

2005-07-19 Thread sampo . etelavuori
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.

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