Re: [Rd] View() + "End" key on Ubuntu=segfault

2008-02-10 Thread Peter Dalgaard
Ben Bolker wrote:
>I can repeatably crash R (segfault)
>
>   by doing
>
> n <- 10
> z <- data.frame(a=1:n,b=1:n)
> View(z)
>
>   and then hitting the "End" key on my keyboard.
>
>I haven't got debugging going yet, but running under
> gdb (without debugging symbols) does give this:
>
> 0xb7b63583 in strlen () from /lib/tls/i686/cmov/libc.so.6
>   
AArrgh There's always one more, isn't there?

Same thing with Fedora, and you don't even have to create the data 
frame: View(airquality), press End suffices. I have

(gdb) bt
#0  0x009c2153 in strlen () from /lib/libc.so.6
#1  0x001d9289 in drawwindow (DE=0x96ca3e8)
at ../../../../R/src/modules/X11/dataentry.c:1380
#2  0x001da0ec in doSpreadKey (DE=0x96ca3e8, key=,
event=)
at ../../../../R/src/modules/X11/dataentry.c:1701
#3  0x001dc93a in R_ProcessX11Events (data=0x0)

at ../../../../R/src/modules/X11/dataentry.c:1380
1380printstring(DE, p, strlen(p), 0, i - DE->colmin + 1, 0);
(gdb) p p
No symbol "p" in current context.
(gdb) l
1375const char *p;
1376int i;
1377
1378for (i = DE->colmin; i <= DE->colmax; i++) {
1379p = get_col_name(DE, i);
1380printstring(DE, p, strlen(p), 0, i - DE->colmin + 1, 0);
1381}
1382for (i = DE->rowmin; i <= DE->rowmax; i++) {
1383sprintf(clab, DE->labform, i);
1384printstring(DE, clab, strlen(clab), i - DE->rowmin + 1, 
0, 0);

at which point the optimizer seems to have messed things up too much for 
further tracing.


> R version 2.6.2 (2008-02-08)
> i486-pc-linux-gnu
>
> [Ubuntu Gutsy]
>
> locale:
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>   


-- 
   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


Re: [Rd] View() + "End" key on Ubuntu=segfault

2008-02-10 Thread Prof Brian Ripley
It's a generic problem with the X11 dataeditor using End.  It was trying 
to start at column 0.

Fixed now.

On Sat, 9 Feb 2008, Ben Bolker wrote:

>
>   I can repeatably crash R (segfault)
>
>  by doing
>
> n <- 10
> z <- data.frame(a=1:n,b=1:n)
> View(z)
>
>  and then hitting the "End" key on my keyboard.
>
>   I haven't got debugging going yet, but running under
> gdb (without debugging symbols) does give this:
>
> 0xb7b63583 in strlen () from /lib/tls/i686/cmov/libc.so.6
>
> R version 2.6.2 (2008-02-08)
> i486-pc-linux-gnu
>
> [Ubuntu Gutsy]
>
> locale:
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> __
> 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] print.fitdistr buglet

2008-02-10 Thread Duncan Murdoch
On 09/02/2008 11:33 AM, Enrico Rossi wrote:
> Dear developers,
> 
> There's a small bug in print.fitdistr that can cause output to be printed
> twice, but only if print is called explicitly:
> 
>> fit<-fitdistr(rt(1000,3),"t")
> There were 11 warnings (use warnings() to see them)
>> fit
> m sdf
>   -0.021817231.001452963.13723878
>  ( 0.03865057) ( 0.03999447) ( 0.33298377)
>> print(fit)
> m sdf
>   -0.021817231.001452963.13723878
>  ( 0.03865057) ( 0.03999447) ( 0.33298377)
> m sdf
>   -0.021817231.001452963.13723878
>  ( 0.03865057) ( 0.03999447) ( 0.33298377)
> 
> Most likely, the function print.fitdistr doesn't return the input invisibly.

I've fixed a number of instances of this kind of thing in the base 
packages now.  A related kind of error I also fixed were print methods 
that returned an invisible NULL, or something other than what was 
printed.  I didn't touch the recommended packages.

These fixes are in R-patched now.

Duncan Murdoch

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


Re: [Rd] help with R rendering engine

2008-02-10 Thread Paul Murrell
Hi


Michael Lawrence wrote:
> On Feb 7, 2008 4:49 PM, Mark W Kimpel <[EMAIL PROTECTED]> wrote:
> 
>> I'm doing some work on a potential patch to the Bioconductor package
>> Rgraphviz and have some questions on code that is contained in engine.c.
>> In particular, I am developing some custom shapes using polygon and need
>> to make sure that, with rendering, the line connecting the centers of
>> two polygons stops at the border of each polygon. The polygons can be
>> transparent, so the option of just rendering the lines first won't work.
>>
>> Is there some help for me with an R internal or perhaps a higher level
>> function?
>>
> 
> I have to admit I am not that familiar with R graphics, but a very common
> way to achieve this in general is to use clipping. That is, you would set
> the regions covered by your node polygons as the "clip" and then draw your
> edges. Anything drawn onto the clip region is discarded. You would then
> reset the clip and continue drawing.
> 
> I'm pretty sure that base R does not support the complex clip regions you
> would require. However, it would be possible to do this in R by rendering to


That's right.  R's graphics engine only copes with rectangular clipping
regions.

OTOH, the 'grid' package does have a facility to determine locations on
the edges of objects (see grobX() abnd grobY()).  This is not
fully-featured, but for convex polygons it might give you what you want.
There's an example or two in
http://www.stat.auckland.ac.nz/~paul/Talks/rgraphs.pdf

Paul


> pixmaps in memory and then compositing the pixmaps. The first part is
> supported by the cairoDevice package and the latter part by RGtk2 (in
> particular its binding to GDK). I'm sure you'd rather not introduce such a
> dependency on Rgraphviz, but it's an option. I think the graphviz developers
> are moving towards GTK+/Cairo in terms of plugins and other work.
> 
> I checked libgd (already a dependency of graphviz) but found that it only
> supports a single rectangle for clipping.
> 
> Anyway, I hope this helps a little and good luck,
> Michael
> 
> 
>> Thanks,
>> Mark
>> --
>>
>> Mark W. Kimpel MD  ** Neuroinformatics ** Dept. of Psychiatry
>> Indiana University School of Medicine
>>
>> 15032 Hunter Court, Westfield, IN  46074
>>
>> (317) 490-5129 Work, & Mobile & VoiceMail
>> (317) 204-4202 Home (no voice mail please)
>>
>> mwkimpelgmailcom
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[EMAIL PROTECTED]
http://www.stat.auckland.ac.nz/~paul/

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


Re: [Rd] help with R rendering engine

2008-02-10 Thread Mark W Kimpel
Paul and Michael,

Thanks for the information. Yes, it appears that what I want is to be 
able to present R with a convex polygon for the clipping path. As I 
waited for comments (for some reason Michael's email did not get to me), 
I began working on my own methods. I am essentially using a matrix in R 
to represent pixel-space and using my own edge-detection algorithm. As I 
write this, I believe I am almost there, but testing awaits tomorrow. 
The real question will be how fast it actually runs. I'll report back 
later this week.

Mark

Mark W. Kimpel MD  ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN  46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 204-4202 Home (no voice mail please)

mwkimpelgmailcom

**


Paul Murrell wrote:
> Hi
> 
> 
> Michael Lawrence wrote:
>> On Feb 7, 2008 4:49 PM, Mark W Kimpel <[EMAIL PROTECTED]> wrote:
>>
>>> I'm doing some work on a potential patch to the Bioconductor package
>>> Rgraphviz and have some questions on code that is contained in engine.c.
>>> In particular, I am developing some custom shapes using polygon and need
>>> to make sure that, with rendering, the line connecting the centers of
>>> two polygons stops at the border of each polygon. The polygons can be
>>> transparent, so the option of just rendering the lines first won't work.
>>>
>>> Is there some help for me with an R internal or perhaps a higher level
>>> function?
>>>
>> I have to admit I am not that familiar with R graphics, but a very common
>> way to achieve this in general is to use clipping. That is, you would set
>> the regions covered by your node polygons as the "clip" and then draw your
>> edges. Anything drawn onto the clip region is discarded. You would then
>> reset the clip and continue drawing.
>>
>> I'm pretty sure that base R does not support the complex clip regions you
>> would require. However, it would be possible to do this in R by rendering to
> 
> 
> That's right.  R's graphics engine only copes with rectangular clipping
> regions.
> 
> OTOH, the 'grid' package does have a facility to determine locations on
> the edges of objects (see grobX() abnd grobY()).  This is not
> fully-featured, but for convex polygons it might give you what you want.
> There's an example or two in
> http://www.stat.auckland.ac.nz/~paul/Talks/rgraphs.pdf
> 
> Paul
> 
> 
>> pixmaps in memory and then compositing the pixmaps. The first part is
>> supported by the cairoDevice package and the latter part by RGtk2 (in
>> particular its binding to GDK). I'm sure you'd rather not introduce such a
>> dependency on Rgraphviz, but it's an option. I think the graphviz developers
>> are moving towards GTK+/Cairo in terms of plugins and other work.
>>
>> I checked libgd (already a dependency of graphviz) but found that it only
>> supports a single rectangle for clipping.
>>
>> Anyway, I hope this helps a little and good luck,
>> Michael
>>
>>
>>> Thanks,
>>> Mark
>>> --
>>>
>>> Mark W. Kimpel MD  ** Neuroinformatics ** Dept. of Psychiatry
>>> Indiana University School of Medicine
>>>
>>> 15032 Hunter Court, Westfield, IN  46074
>>>
>>> (317) 490-5129 Work, & Mobile & VoiceMail
>>> (317) 204-4202 Home (no voice mail please)
>>>
>>> mwkimpelgmailcom
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>  [[alternative HTML version deleted]]
>>
>> __
>> 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