So I have come up with this code so far but have now run into errors getting spit out back at me. I am trying to separate this dataset into weight groups listed <60, 60-70, >70 and then add it back to my data frame. I am a beginner too, so I think I did something wrong here.
runif(50, 55, 80)
rnorm(50, 176, 6)
runif(50, 65, 100)
DF <- data.frame(Height = rnorm(50, 170, 5),
Weight = rnorm(50, 55, 5))
weight.group = factor(NA, levels = c("0-60", "61-70", "71+"))
idx = which(rnorm <= 60)
weight.group[idx] = rep("0-60", length(idx))
idx = which(weight = 61 - 70)
weight.group[idx] = rep("61-70", length(idx))
idx = which(weight >= 71)
weight.group[idx] = rep("71+", length(idx))