I understand that you can sample elements from a list using:
list1 <- list(x, y) A <- sample(list1, 1)
If A is x, how do I store the value of y in B, without using an if statement?
A
x
y
B
if
1.4m articles
1.4m replys
5 comments
57.0k users