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

akshay kulkarni @k@h@y_e4 @end|ng |rom hotm@||@com
Wed Sep 7 20:35:30 CEST 2022

Dear members,
                             The following is my code:

> Stst <- 2
> switch(Stst, 1 = print("NO"), 2 = print("YES"))
Error: unexpected '=' in "switch(Stst, 1 ="

Why isn't it printing "YES" on to the console?

many thanks in advance.

Thanking you,
Yours sincerely,

	[[alternative HTML version deleted]]

More information about the R-help mailing list