Re: [R] heplot3d / rgl : example causes R GUI to crash

2010-02-12 Thread Michael Friendly

Duncan Murdoch wrote:


I tracked this down.  It's a bug in rgl, but likely also a bug in 
heplots. At line 93 of heplot3d.mlm.R, called from line 198 in the 
same file, there's a call


texts3d(x[which.max(x[,2]),] + offset*ranges, adj=0, 
texts=label, color=col, lit=FALSE)


At this point "label" is NULL, and that crashes rgl.  I'll fix rgl so 
there's no crash, but I suspect that heplots probably meant to pass a 
non-null label here.


Duncan Murdoch

Thanks, Duncan
I've now fixed heplot3d.mlm so this won't occur, but also my sample call,

heplot3d(soils.mod, variables=c("Mg", "Ca", "Na"), 
hypotheses="ContourSlope")


should have supplied a named list for hypotheses:
heplot3d(soils.mod, variables=c("Mg", "Ca", "Na"), 
hypotheses=list(C1="ContourSlope"))




--
Michael Friendly Email: friendly AT yorku DOT ca 
Professor, Psychology Dept.

York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] heplot3d / rgl : example causes R GUI to crash

2010-02-12 Thread Duncan Murdoch

On 10/02/2010 11:07 AM, Michael Friendly wrote:

Duncan Murdoch wrote:

On 10/02/2010 9:33 AM, Michael Friendly wrote:

[Env: Tested under Win Xp, R 2.9.2 and R 2.10.1; sessionInfo() at end]
  
This is probably a bug in rgl, and I can reproduce it.  Bugs in 
contributed packages are best sent to the maintainer of the package, 
because otherwise they might be lost.  In this case I did see it, so 
no need for you to do anything more.


Duncan Murdoch

Thanks, Duncan
FMI, if you (or anyone) has pointers on how to debug such things, I'd 
like to learn.




I tracked this down.  It's a bug in rgl, but likely also a bug in 
heplots. At line 93 of heplot3d.mlm.R, called from line 198 in the same 
file, there's a call


		texts3d(x[which.max(x[,2]),] + offset*ranges, adj=0, texts=label, 
color=col, lit=FALSE)


At this point "label" is NULL, and that crashes rgl.  I'll fix rgl so 
there's no crash, but I suspect that heplots probably meant to pass a 
non-null label here.


Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] heplot3d / rgl : example causes R GUI to crash

2010-02-10 Thread Michael Friendly

Duncan Murdoch wrote:

On 10/02/2010 9:33 AM, Michael Friendly wrote:

[Env: Tested under Win Xp, R 2.9.2 and R 2.10.1; sessionInfo() at end]
  


This is probably a bug in rgl, and I can reproduce it.  Bugs in 
contributed packages are best sent to the maintainer of the package, 
because otherwise they might be lost.  In this case I did see it, so 
no need for you to do anything more.


Duncan Murdoch

Thanks, Duncan
FMI, if you (or anyone) has pointers on how to debug such things, I'd 
like to learn.


--
Michael Friendly Email: friendly AT yorku DOT ca 
Professor, Psychology Dept.

York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] heplot3d / rgl : example causes R GUI to crash

2010-02-10 Thread Duncan Murdoch

On 10/02/2010 11:07 AM, Michael Friendly wrote:

Duncan Murdoch wrote:
> On 10/02/2010 9:33 AM, Michael Friendly wrote:
>> [Env: Tested under Win Xp, R 2.9.2 and R 2.10.1; sessionInfo() at end]
>>   
>
> This is probably a bug in rgl, and I can reproduce it.  Bugs in 
> contributed packages are best sent to the maintainer of the package, 
> because otherwise they might be lost.  In this case I did see it, so 
> no need for you to do anything more.

>
> Duncan Murdoch
Thanks, Duncan
FMI, if you (or anyone) has pointers on how to debug such things, I'd 
like to learn.


  


It's not easy, but the general idea is to do it in gdb, possibly with a 
nicer front end (I use Insight).  I wrote up instructions on doing this 
in Windows a few years ago.  I think they still work; if you try this 
and notice anything in my instructions that is out of date, please let 
me know.


The instructions are on 
http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/, in the 
page "Using gdb to debug C or Fortran code 
".


Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] heplot3d / rgl : example causes R GUI to crash

2010-02-10 Thread Duncan Murdoch

On 10/02/2010 9:33 AM, Michael Friendly wrote:

[Env: Tested under Win Xp, R 2.9.2 and R 2.10.1; sessionInfo() at end]
  


This is probably a bug in rgl, and I can reproduce it.  Bugs in 
contributed packages are best sent to the maintainer of the package, 
because otherwise they might be lost.  In this case I did see it, so no 
need for you to do anything more.


Duncan Murdoch
I've run into a problem with the heplot3d() function in my heplots 
package which causes the R GUI to crash
('R for Windows GUI encountered a problem and needs to close...'). I 
think the problem comes from an
rgl call, but, I can't get a traceback or other information because my R 
session crashes. I've never seen this

behavior before.


The problem occurs *whenever* I try to supply linear hypotheses to be 
displayed along with the model

terms. Here is a small example:

library(heplots)
# Soils data, from car package
soils.mod <- lm(cbind(pH,N,Dens,P,Ca,Mg,K,Na,Conduc) ~ Block + 
Contour*Depth, data=Soils)

Anova(soils.mod)

heplot(soils.mod, variables=c("Ca", "Mg"))
## this works OK
heplot3d(soils.mod, variables=c("Mg", "Ca", "Na"))

## this crashes R, but it draws most of the plot first
heplot3d(soils.mod, variables = c("Mg", "Ca", "Na"), hypotheses = 
"ContourSlope")


## linear.hypothesis does work on this:
 > print(linear.hypothesis(soils.mod, "ContourSlope"), SSP=FALSE)

Multivariate Tests:
Df test stat approx F num Df den Df Pr(>F)
Pillai 1 0.5844882 3.907418 9 25 0.003312 **
Wilks 1 0.4155118 3.907418 9 25 0.003312 **
Hotelling-Lawley 1 1.4066706 3.907418 9 25 0.003312 **
Roy 1 1.4066706 3.907418 9 25 0.003312 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
 >

I would be grateful if someone could (a) confirm that this is a general 
problem, not just my system; (b)

suggest how to determine what is going wrong.

 > sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rgl_0.89 heplots_0.8-11 car_1.2-16
 >




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] heplot3d / rgl : example causes R GUI to crash

2010-02-10 Thread Michael Friendly

[Env: Tested under Win Xp, R 2.9.2 and R 2.10.1; sessionInfo() at end]

I've run into a problem with the heplot3d() function in my heplots 
package which causes the R GUI to crash
('R for Windows GUI encountered a problem and needs to close...'). I 
think the problem comes from an
rgl call, but, I can't get a traceback or other information because my R 
session crashes. I've never seen this

behavior before.


The problem occurs *whenever* I try to supply linear hypotheses to be 
displayed along with the model

terms. Here is a small example:

library(heplots)
# Soils data, from car package
soils.mod <- lm(cbind(pH,N,Dens,P,Ca,Mg,K,Na,Conduc) ~ Block + 
Contour*Depth, data=Soils)

Anova(soils.mod)

heplot(soils.mod, variables=c("Ca", "Mg"))
## this works OK
heplot3d(soils.mod, variables=c("Mg", "Ca", "Na"))

## this crashes R, but it draws most of the plot first
heplot3d(soils.mod, variables = c("Mg", "Ca", "Na"), hypotheses = 
"ContourSlope")


## linear.hypothesis does work on this:
> print(linear.hypothesis(soils.mod, "ContourSlope"), SSP=FALSE)

Multivariate Tests:
Df test stat approx F num Df den Df Pr(>F)
Pillai 1 0.5844882 3.907418 9 25 0.003312 **
Wilks 1 0.4155118 3.907418 9 25 0.003312 **
Hotelling-Lawley 1 1.4066706 3.907418 9 25 0.003312 **
Roy 1 1.4066706 3.907418 9 25 0.003312 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>

I would be grateful if someone could (a) confirm that this is a general 
problem, not just my system; (b)

suggest how to determine what is going wrong.

> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rgl_0.89 heplots_0.8-11 car_1.2-16
>

--
Michael Friendly Email: friendly AT yorku DOT ca 
Professor, Psychology Dept.

York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.