rl at openmailbox.org
2014-Sep-05 09:40 UTC
[R] sequential input script dataframe process functionality
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 > SummaryX, [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.
rl at openmailbox.org
2014-Sep-06 13:14 UTC
[R] sequential input script dataframe process functionality
On 2014-09-05 09:40, rl at 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> testdataextract1NULL The requested output is: "text test1","other textx",100 Why is the result 'NULL'?