Bug 15449 - multi-page plot created by plot.TukeyHSD does not create image in windows device (only)
multi-page plot created by plot.TukeyHSD does not create image in windows dev...
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Windows GUI / Window specific
R 3.0.1
ix86 (32-bit) Windows 32-bit
: P5 minor
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-10 13:07 UTC by C Campbell
Modified: 2013-09-10 13:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description C Campbell 2013-09-10 13:07:00 UTC
What happened:

Running the following code causes the windows graphics device to wheel.
The PDF device works as expected (see attachment test_tukey.pdf).
The x11 device works as expected on a Unix box.

###########################################################################

Steps to reproduce:

con <- textConnection("
Subj  Drug1 Drug2 Drug3 Drug4
1     31    29    17    35
2     15    17    11    23
3     25    21    19    31
4     35    35    21    45
5     27    27    15    31
")

repStudy <- read.table(con, header = TRUE)

repSt <- expand.grid(Subj = 1:5, Drug = 1:4)
repSt$Value <- unlist(repStudy[, 2:5])
repSt <- repSt[order(repSt$Subj, repSt$Drug), ]
repSt$Subj <- factor(repSt$Subj)
repSt$Drug <- factor(repSt$Drug)
head(repSt)
drugs <- repSt

drugs_aov <- aov(Value ~ Subj + Drug, data = drugs)

summary(drugs_aov)

# F is large, which suggests that there is 
# a statistically significant difference
# between the treatments

tda <- TukeyHSD(drugs_aov)
plot(tda)


###########################################################################


Sample output:

###########################################################################

### From the command line (R-2.14.1 on path)

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\ccampbell>R

R version 2.14.1 (2011-12-22)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> con <- textConnection("
+ Subj  Drug1 Drug2 Drug3 Drug4
+ 1     31    29    17    35
+ 2     15    17    11    23
+ 3     25    21    19    31
+ 4     35    35    21    45
+ 5     27    27    15    31
+ ")
>
> repStudy <- read.table(con, header = TRUE)
>
> repSt <- expand.grid(Subj = 1:5, Drug = 1:4)
> repSt$Value <- unlist(repStudy[, 2:5])
> repSt <- repSt[order(repSt$Subj, repSt$Drug), ]
> repSt$Subj <- factor(repSt$Subj)
> repSt$Drug <- factor(repSt$Drug)
> head(repSt)
   Subj Drug Value
1     1    1    31
6     1    2    29
11    1    3    17
16    1    4    35
2     2    1    15
7     2    2    17
> drugs <- repSt
>
> drugs_aov <- aov(Value ~ Subj + Drug, data = drugs)
>
> summary(drugs_aov)
            Df Sum Sq Mean Sq F value   Pr(>F)
Subj         4  648.0   162.0   21.32 2.21e-05 ***
Drug         3  683.8   227.9   29.99 7.38e-06 ***
Residuals   12   91.2     7.6
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> # F is large, which suggests that there is
> # a statistically significant difference
> # between the treatments
>
> tda <- TukeyHSD(drugs_aov)
> plot(tda)
>



###########################################################################

### From the command line (naming R-3.0.1)

C:\Users\ccampbell>"C:\Program Files\R\R-3.0.1\bin\i386\R" --vanilla

R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> con <- textConnection("
+ Subj  Drug1 Drug2 Drug3 Drug4
+ 1     31    29    17    35
+ 2     15    17    11    23
+ 3     25    21    19    31
+ 4     35    35    21    45
+ 5     27    27    15    31
+ ")
>
> repStudy <- read.table(con, header = TRUE)
>
> repSt <- expand.grid(Subj = 1:5, Drug = 1:4)
> repSt$Value <- unlist(repStudy[, 2:5])
> repSt <- repSt[order(repSt$Subj, repSt$Drug), ]
> repSt$Subj <- factor(repSt$Subj)
> repSt$Drug <- factor(repSt$Drug)
> head(repSt)
   Subj Drug Value
1     1    1    31
6     1    2    29
11    1    3    17
16    1    4    35
2     2    1    15
7     2    2    17
> drugs <- repSt
>
> drugs_aov <- aov(Value ~ Subj + Drug, data = drugs)
>
> summary(drugs_aov)
            Df Sum Sq Mean Sq F value   Pr(>F)
Subj         4  648.0   162.0   21.32 2.21e-05 ***
Drug         3  683.8   227.9   29.99 7.38e-06 ***
Residuals   12   91.2     7.6
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> # F is large, which suggests that there is
> # a statistically significant difference
> # between the treatments
>
> tda <- TukeyHSD(drugs_aov)
> plot(tda)
>
>
> version
               _
platform       i386-w64-mingw32
arch           i386
os             mingw32
system         i386, mingw32
status
major          3
minor          0.1
year           2013
month          05
day            16
svn rev        62743
language       R
version.string R version 3.0.1 (2013-05-16)
nickname       Good Sport
Comment 1 Duncan Murdoch 2013-09-10 13:29:15 UTC
The problem is that the function calls dev.hold() twice, but dev.flush() only once.  I'm surprised you found it working anywhere; it doesn't work for me on OSX.

Will fix.
Comment 2 Duncan Murdoch 2013-09-10 13:54:22 UTC
Fixed in R-devel and R-patched.