Re: [R] inconsistency in switch statements.....

2022-09-08 Thread Bill Dunlap
fier but`2` is! > > > > Yours sincerely, > > AKSHAY M KULKARNI > > > > ____ > > From: Bert Gunter > > Sent: Thursday, September 8, 2022 12:39 AM > > To: akshay kulkarni > > Cc: R help Mailing list > > Subjec

Re: [R] inconsistency in switch statements.....

2022-09-08 Thread Richard O'Keefe
got to know that > 2 is not a valid identifier but`2` is! > > Yours sincerely, > AKSHAY M KULKARNI > > > From: Bert Gunter > Sent: Thursday, September 8, 2022 12:39 AM > To: akshay kulkarni > Cc: R help Mailing list > Subject: Re: [R]

Re: [R] inconsistency in switch statements.....

2022-09-07 Thread akshay kulkarni
to know that 2 is not a valid identifier but`2` is! Yours sincerely, AKSHAY M KULKARNI From: Bert Gunter Sent: Thursday, September 8, 2022 12:39 AM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] inconsistency in switch statements. Well

Re: [R] inconsistency in switch statements.....

2022-09-07 Thread Bert Gunter
Well, as it states on the Help page, which should always be the first place to look for, ummm, help: "If the value of EXPR is not a character string it is coerced to integer. Note that this also happens for factors, with a warning, as typically the character level is meant. If the integer is

Re: [R] inconsistency in switch statements.....

2022-09-07 Thread akshay kulkarni
Dear Andrew, Its working. Thanks a lot Yours sincerely, AKSHAY M KULKARNI From: Andrew Simmons Sent: Thursday, September 8, 2022 12:08 AM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] inconsistency in switch

Re: [R] inconsistency in switch statements.....

2022-09-07 Thread Andrew Simmons
1 and 2 are not valid identifiers in R, so you need to surround them with backticks to make them valid, the same as quoting a string: switch(Stst, `1` = print("NO"), `2` = print("YES")) On Wed., Sep. 7, 2022, 14:35 akshay kulkarni, wrote: > Dear members, > The