How can you create a vector in R which consists of a sequence of different words?
Something like Vec_Sex
:
for 0
to 6
, input "Male"
and for 7
to 9
, input "Female"
...
I know shortcuts like rep(1:3,times=4)
etc... But even after flicking through my lecture notes and a goole search, I'm unsure how to achieve this with words and when the amount of elements that contain that word differ...
Outcome would be something like:
Vec_Sex = [ Male, Male, Male, Male, Male, Male, Male, Female, Female, Female ]
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…