Entering edit mode
3.5 years ago
mlganjnameh
•
0
Hi, I have a dataframe like this.
gen <- rep(c("1","2"), each=10)
phen = seq(from = 1, to = 20, by = 1)
y <- data.frame(gen, phen)
I want to based on each group of gen (1 and 2) replace 20 percent of phen to 0. How i can do that? Tnx
Thanks Is that another way without using special package?