Error in adding data in columns of R data frame
Add the Cytogenetics columns and then assign things to a subset of it.

metadata &lt;- data.frame(row.names = colnames(df1))
metadata$Group &lt;- NA     # you don't need to write a vector; just NA does the job
metadata$Group[seq(1,4,1)] &lt;- 'HSC'
metadata$Group[seq(5,15,1)] &lt;- 'Blast'
metadata$Group[seq(16,23,1)] &lt;- 'LSC'
metadata$Cytogenetics &lt;- NA    # initiate the column with NA values
metadata$Cytogenetics[seq(1,4,1)] &lt;- 'Healthy'
metadata$Cytogenetics[seq(5,21,1)] &lt;- 'NK'
metadata$Cytogenetics[seq(22,23,1)] &lt;- 'Abnormal'