jeitel at vandals.uidaho.edu
2010-Nov-11 17:52 UTC
[R] User input after opening graphing device
If I run the following:> windows() > > bringToTop(-1) > > interactive()[1] TRUE> > run <- readline(prompt = "Continue (Yes = 1, No = 2):")Continue (Yes = 1, No = 2):> dummy <- 1 > run[1] "" it does not allow user input though the session is interactive (it jumps right over the readline command). It would be great if you would have any suggestions of how to solve the problem. Thanks, Jan [[alternative HTML version deleted]]
PLEASE follow the posting guide and give us the output of sessionInfo(). I was unable to duplicate your problem -- it worked fine for me.> sessionInfo()R version 2.12.0 (2010-10-15) Platform: i386-pc-mingw32/i386 (32-bit) 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] datasets splines grid tcltk stats graphics grDevices [8] utils methods base other attached packages: [1] TinnR_1.0.3 R2HTML_2.2 Hmisc_3.8-3 survival_2.35-8 [5] svSocket_0.9-48 lattice_0.19-13 MASS_7.3-8 loaded via a namespace (and not attached): [1] cluster_1.13.1 svMisc_0.9-60 tools_2.12.0 -- Bert On Thu, Nov 11, 2010 at 9:52 AM, <jeitel at vandals.uidaho.edu> wrote:> > If I run the following: > >> windows() >> >> bringToTop(-1) >> >> interactive() > [1] TRUE >> >> run <- readline(prompt = "Continue (Yes = 1, No = 2):") > Continue (Yes = 1, No = 2): >> dummy <- 1 >> run > [1] "" > > it does not allow user input though the session is interactive (it jumps right over the readline command). > > It would be great if you would have any suggestions of how to solve the problem. > > Thanks, > > Jan > > > > > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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. >-- Bert Gunter Genentech Nonclinical Biostatistics
Bert Gunter <gunter.berton <at> gene.com> writes:> > PLEASE follow the posting guide and give us the output of sessionInfo(). > > I was unable to duplicate your problem -- it worked fine for me. > > > sessionInfo() > R version 2.12.0 (2010-10-15) > Platform: i386-pc-mingw32/i386 (32-bit) > > 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] datasets splines grid tcltk stats graphics grDevices > [8] utils methods base > > other attached packages: > [1] TinnR_1.0.3 R2HTML_2.2 Hmisc_3.8-3 survival_2.35-8 > [5] svSocket_0.9-48 lattice_0.19-13 MASS_7.3-8 > > loaded via a namespace (and not attached): > [1] cluster_1.13.1 svMisc_0.9-60 tools_2.12.0It works if you run it line by line. However, if you copy and paste all following six lines into R: windows() bringToTop(-1) interactive() run <- readline(prompt = "Continue (Yes = 1, No = 2):") dummy <- 1 run it does not allow user input (e.g. it does not prompt you "Continue (Yes = 1, No = 2):"). Session Info: R version 2.12.0 (2010-10-15) Platform: x86_64-pc-mingw32/x64 (64-bit) 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
On 12/11/2010 8:58 AM, Jan Eitel wrote:> Bert Gunter<gunter.berton<at> gene.com> writes: > > > > > PLEASE follow the posting guide and give us the output of sessionInfo(). > > > > I was unable to duplicate your problem -- it worked fine for me. > > > > > sessionInfo() > > R version 2.12.0 (2010-10-15) > > Platform: i386-pc-mingw32/i386 (32-bit) > > > > 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] datasets splines grid tcltk stats graphics grDevices > > [8] utils methods base > > > > other attached packages: > > [1] TinnR_1.0.3 R2HTML_2.2 Hmisc_3.8-3 survival_2.35-8 > > [5] svSocket_0.9-48 lattice_0.19-13 MASS_7.3-8 > > > > loaded via a namespace (and not attached): > > [1] cluster_1.13.1 svMisc_0.9-60 tools_2.12.0 > > > > > It works if you run it line by line. However, if you copy and paste all > following six lines into R: > > windows() > bringToTop(-1) > interactive() > run<- readline(prompt = "Continue (Yes = 1, No = 2):") > dummy<- 1 > run > > > it does not allow user input (e.g. it does not prompt you "Continue (Yes = 1, > No = 2):").Sure it does, and then you type "dummy <- 1", and that satisfies it. Cutting and pasting is all interpreted as typing. (How else could it work???) If you want the interactivity, you can use source("clipboard"). Duncan Murdoch