0

I'd like to make a data frame column that some values are repeated in it. but the repetition number is not the same for all values.

I am expecting something like this


  column1
1 A
2 A
3 A
4 A
5 B
6 B
7 B

I know how to make a data frame column with the same repetition for all values:

df = data.frame(
  column1 = factor(rep(c("A","B"), each=4)

0 Answers0