I'm trying to use the following loop to open a window multiple times
to select files, but only the last window shows up. What am I missing?
library(tcltk)
nWin <- 6
fn <- vector('list', nWin)
for (ii in nWin) {
fn[[ii]] <- tclvalue( tkgetOpenFile( filetypes =
"{{Files} {.1D}} {{All files} *}",
title = paste('Choose number', ii, 'time series file')))
}
TIA,
Gang
trouble with tkgetOpenFile
3 messages · Gang Chen, John Fox
Dear Gang, Your for loop is in error; try for (ii in seq(length=nWin)) I hope this helps, John ------------------------------ John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada web: socserv.mcmaster.ca/jfox
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
Behalf Of Gang Chen
Sent: September-17-08 4:31 PM
To: r-help at stat.math.ethz.ch
Subject: [R] trouble with tkgetOpenFile
I'm trying to use the following loop to open a window multiple times
to select files, but only the last window shows up. What am I missing?
library(tcltk)
nWin <- 6
fn <- vector('list', nWin)
for (ii in nWin) {
fn[[ii]] <- tclvalue( tkgetOpenFile( filetypes =
"{{Files} {.1D}} {{All files} *}",
title = paste('Choose number', ii, 'time series file')))
}
TIA,
Gang
______________________________________________ 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.
Such a silly mistake! Thanks a lot, John! Gang
On Wed, Sep 17, 2008 at 7:21 PM, John Fox <jfox at mcmaster.ca> wrote:
Dear Gang, Your for loop is in error; try for (ii in seq(length=nWin)) I hope this helps, John ------------------------------ John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada web: socserv.mcmaster.ca/jfox
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
Behalf Of Gang Chen
Sent: September-17-08 4:31 PM
To: r-help at stat.math.ethz.ch
Subject: [R] trouble with tkgetOpenFile
I'm trying to use the following loop to open a window multiple times
to select files, but only the last window shows up. What am I missing?
library(tcltk)
nWin <- 6
fn <- vector('list', nWin)
for (ii in nWin) {
fn[[ii]] <- tclvalue( tkgetOpenFile( filetypes =
"{{Files} {.1D}} {{All files} *}",
title = paste('Choose number', ii, 'time series file')))
}
TIA,
Gang