I have created a vector via the following and would like to repeat the value of each column for 307 obs so that I can cbind it to a dataframe I have:
weightvalues <- c(0.3,0.7,
0.3,0.4,0.2,0.1,
0.85,0.15,
0.25,0.25,0.2,0.2,0.1,
0.4,0.6,
0.4,0.6)
names(weightvalues) <- c("IC.TurnoverWeight","Branch.TurnoverWeight",
"Total.CallsWeight","Substantiated.CallsWeight","Unsubstantiated.CallsWeight","Branch.HeadcountWeight",
"PC.Cancel.RateWeight","TC.Cancel.RateWeight",
"VOE.2017.SERVWeight","VOE.2017.Acct.EmpWeight","VOE.2017.CustWeight","VOE.2017.EthicsWeight","VOE.2017.SafetyWeight",
"June.VOE.Participation.PercentWeight","July.VOE.Participation.PercentWeight",
"NPS.Score.TCWeight","NPS.Score.PCWeight")
weightvalues
FinalLaborUnrestDatLVs <- cbind(FinalLaborUnrestDatLVs,weightvalues)
Obviously, since my data frame "FinalLaborUnrestDatLVs" has 307 observations it won't bind with my vector of only one. Is there an easy solution here?
Edit: I guess I can use rep, I'm just struggling figuring out this function.