On 2014-09-05 09:40, r...@openmailbox.org wrote:
Subscribers,
Could someone please indicate correct terminology and relevant manual
sections to achieve the following conceptual workflow, to create a
script to select sequentially parts of a dataframe:
"Welcome to this R script program"
Select level number below of variable 'X'
[1]
[2]
[3]
3
Select level number below of variable 'Y'
[1]
[2]
1
Summary
X, [2] 'descriptive text A for level 3 selected'
[1] 'descriptive text B for level 1 selected'
Display graph? Y/N
y
[specific selected script activated, graph displayed]
Thanks in advance.
--
N.B. digest mode subscriber; please cc message.
For a test csv file:
variablea,variableb,variablec
"text test1","other textx",100
"text test2","other texty",200
"text test3","other textz",400
Tried the following:
testdata<-read.csv('test.csv')
testdataextract1<-switch(menu(c(unique(levels(testdata[,1]))),graphics=FALSE,title='Select
something'))
Select something
1: text test1
2: text test2
3: text test3
Selection: 1
testdataextract1
NULL
The requested output is:
"text test1","other textx",100
Why is the result 'NULL'?
______________________________________________
R-help@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.