Essentially, I am taking a list of emotions and trying to replicate each emotion on the list 6 times and then add them to a vector. For example:
emotions<-c("Happy","Sad","Angry")
will look like:
emotions2<-c("Happy","Happy","Happy","Happy","Happy","Happy","Sad","Sad","Sad","Sad","Sad","Angry","Angry","Angry","Angry","Angry","Angry")
Right now to do this, I am using a for loop but for some reason it's only replicating the first emotion, creating the vector, emotions2<-c("Happy","Happy","Happy","Happy","Happy","Happy").
My code looks like this: pmd.df3 is my data frame and Emotions is the new column in it where I'll store this info.
pmd.df3$Emotions<-(
for(ele in emotions){
new.column<-replicate(6,ele)
print(new.column)
}
)
Please let me know if you can help!