Answers for "how to get a random value from a sample in r"

R
2

random integer in r

random_x <- sample(1:10, 1)

# or

random_10x = sample(-1:1, size = 10, replace = T)
Posted by: Guest on September-09-2020
0

extracting random data set in r

sample <- diamonds[sample(nrow(diamonds),100),]
sample
Posted by: Guest on September-11-2021

Code answers related to "how to get a random value from a sample in r"

Browse Popular Code Answers by Language