
Last chance! 50% off unlimited learning
Sale ends in
rvcompatibility(0)
x <- 1:9
# Will work since rv checks that the value to be injected is an rv:
x[1] <- rvnorm(1)
print(x)
\dontrun{
rvcompatibility(1)
x <- 1:9
# Will fail since R thinks this is assigning a list into a vector component:
x[1] <- rvnorm(1)
print(class(x)) # "list"
}
# However, this works:
x <- as.rv(1:9)
rvcompatibility(1)
x[1] <- rvnorm(1)
rvcompatibility(0) # restore the fully rv-enabled computing environment...
Run the code above in your browser using DataLab