Skip to content
Prev 309488 / 398506 Next

HELP!! how to remove 10% of data randomly in R

If your data frame is called dat, then something like this may do what you want, but since you haven't given an example of what you want the output to look like I am only guessing.

dat[sample(1:30,5),3:8] <- NA


hope this is helpful,

Dan

Daniel J. Nordlund
Olympia, WA 98504-5204