Re: [R] apply block of if statements with menu function

2014-09-22 Thread PIKAL Petr
Hi > -Original Message- > From: r...@openmailbox.org [mailto:r...@openmailbox.org] > Sent: Thursday, September 18, 2014 4:35 PM > To: PIKAL Petr > Cc: r-help@r-project.org > Subject: RE: [R] apply block of if statements with menu function > > On 2014-09-16

Re: [R] apply block of if statements with menu function

2014-09-18 Thread rl
On 2014-09-16 12:35, PIKAL Petr wrote: So if result of menu is 0 (you did not choose anything) you can either stay with 0, then switch does not return anything or add 1 and let evaluate something meaningful specified in second and following positions of switch command. Thanks for your explana

Re: [R] apply block of if statements with menu function

2014-09-16 Thread PIKAL Petr
ot;) > So if result of menu is 0 (you did not choose anything) you can either stay with 0, then switch does not return anything or add 1 and let evaluate something meaningful specified in second and following positions of switch command. Regards Petr > -Original Message- > From: r...@op

Re: [R] apply block of if statements with menu function

2014-09-16 Thread rl
On 2014-09-16 10:50, PIKAL Petr wrote: switch(menu(c("List letters", "List LETTERS")) + 1, cat("Nothing done\n"), letters, LETTERS) why is the result changed if ' + 1,' removed? Because +1 belongs to switch not to menu. You can translate above to: The help pages ?switch, ?menu do no

Re: [R] apply block of if statements with menu function

2014-09-16 Thread PIKAL Petr
ards Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of r...@openmailbox.org > Sent: Tuesday, September 16, 2014 11:10 AM > To: David L Carlson > Cc: r-help@r-project.org > Subject: Re: [R] apply block of i

Re: [R] apply block of if statements with menu function

2014-09-16 Thread rl
On 2014-09-15 14:22, David L Carlson wrote: I think switch() should work for you here, but it is not clear how much flexibility you are trying to have (different tests based on the first response; different tests based on first, then second response; different tests based on each successive respo

Re: [R] apply block of if statements with menu function

2014-09-15 Thread rl
On 2014-09-15 14:22, David L Carlson wrote: I think switch() should work for you here, but it is not clear how much flexibility you are trying to have (different tests based on the first response; different tests based on first, then second response; different tests based on each successive respo

Re: [R] apply block of if statements with menu function

2014-09-15 Thread David L Carlson
I think switch() should work for you here, but it is not clear how much flexibility you are trying to have (different tests based on the first response; different tests based on first, then second response; different tests based on each successive response). ?switch For the second question ju