Re: [R] Having a problem with choose.files

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Sun, 13 Mar 2011 08:46:53 -0400

On 11-03-13 7:11 AM, Carl.Finkbeiner_at_tnsglobal.com wrote:
> I am relatively new to R, and am having a problem with the following
> snippet of code, and I do not at all understand why it is behaving this
> way. I am running Windows XP, with R 2.12.1.
>
> I copy and paste these 4 lines into the R Console:
> t<-c("a","b","c")
> ans<-select.list(t)
> txtNBS<-winDialogString("NBS","300")
> choose.files()
>
> I click on OK in the Select One dialog, and on OK in the Question
> dialog, and then Cancel in the file dialog. Everything behaves as I
> expect it to. (All 3 of those dialog functions are in the utils
> package.)
>
> I then copy and paste these 6 lines defining the function fn, into the R
> Console. Note that the body of the function is exactly the same as the
> 4 lines above that worked well.
> fn<-function() {
> t<-c("a","b","c")
> ans<-select.list(t)
> txtNBS<-winDialogString("NBS","300")
> choose.files()
> }
>
> When I then invoke this function by typing fn() into the R Console, I
> again click OK in the Select One dialog, and on OK in the Question
> dialog. BUT, the file dialog never appears. Furthermore, if I then
> type choose.files() into the R Console, about half the time the file
> dialog appears and about half the time it doesn't.
>
> Any help anyone can give me is much appreciated. I cannot see what I am
> doing wrong here.

Looks like a bug in one of those functions. I'll look into it.

Duncan Murdoch



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. Received on Sun 13 Mar 2011 - 12:51:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 13 Mar 2011 - 13:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive