I'm trying to create a column in my data in .dbf. I need to create a column in which 70% is 0 (or TRUE) and 30% is 1 (or FALSE), only at random.
How can I do this?
If you need for example 100 values, try this:
sample(c(0,1), size = 100, replace = TRUE, prob = c(0.7, 0.3))
2.1m questions
2.1m answers
60 comments
57.0k users