I am trying to create a dataframe containing made up sentences. In order to make the sentences vary I want to sometimes concatenate a string to a pre-existing string and sometimes not
Example input
FD1<-data.frame(c("It is raining","It is snowing","It is stormy")) FD_try<-list(x="a lot",x="a bit") It is raining It is snowing It is stormy Example output 1
It is raining a lot It is snowing It is stormy Example output 1
It is raining It is snowing a lot It is stormy a bit I am currently doing
out <- apply(FD1, 1, function(x) { return(paste(x,sample(FD_try,1,replace=F))) }) but that always inserts from FD_try. How can I make it insert only sometimes?