|
Greetings,
I want to create a dynamic menu that allows
selecting different data files for further analysis.
Here is the input file, minval.out
DC200d100r_a15cl00.tmp
-9.14 3.19 DC200d100r_p15cl00.tmp
-8.38
1.35 DC200d100r_m15cl00.tmp -6.69
2.64
...
100 files in all
I read this file into s-plus
minval.table <-
read.table("minval.out",row.names=NULL,col.names=c("scenario","DOPTmin","MSEmin"))
I would like to use column 1 to dynamically
create a choice list for menu(). Currently, I am hardcoding the
filenames.
cat("\nSELECT SCENARIOS FOR SURFACE
COMPARISON\n") choices <- c("Done adding scenarios","List selected
scenarios","DC200d100r_a15cl00","DC200d100r_p15cl00",
"DC200d100r_m15cl00") pick
<-
menu(choices) switch(pick,
return(),
select.list(),
add.scenario(minval.table[1,1]),
add.scenario(minval.table[2,1]),
add.scenario(minval.table[3,1])) Recall()
Problems I am having...
1) How do I translate minval.table column 1 into a
vector - c(file1,file2,...), for use with menu()?
2) In switch(), I want to use add.scenario(file1)
instead of hardcoding minval.table[1,1]
I know the latest versions of splus have GUI
features for creating drop down boxes that would allow what I want, but I have
no experience with working with the GUI scripting features.
Any help is appreciated.
Cheers -Jon
|