Randomly assigning values to missing data

With this information, the only thing that comes to my mind is sampling with probabilities, to control the amounts of 1s and 2s.

sample(1:2, 10, replace = TRUE, prob = c(0.3, 0.7))
#>  [1] 2 2 1 2 2 2 2 1 2 2

Could you please turn this into a self-contained REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

If you've never heard of a reprex before, you might want to start by reading this FAQ: