RosettaCodeData/Task/Conditional-structures/R/conditional-structures-4.r
2023-07-01 13:44:08 -04:00

6 lines
184 B
R

x <- "match"
switch(x, mat = 0, match = 10, other = 100, 1000)
x <- "ma"
switch(x, mat = 0, match = 10, other = 100, 1000)
x <- "foo"
switch(x, mat = 0, match = 10, other = 100, 1000)