This is my [file][1] df1 = read.csv("HSC_LSC_BLAST_karyotyope.txt",header = TRUE,sep = ",",row.names = 1) metadata <- data.frame(row.names = colnames(df1)) metadata$Group <- rep(NA, ncol(df1)) metadata$Group[seq(1,4,1)] <- 'HSC' metadata$Group[seq(5,15,1)] <- 'Blast' metadata$Group[seq(16,23,1)] <- 'LSC' #metadata$Group[seq(13,16,1)] <- 'Mono' metadata$Cytogenetics[seq(1,4,1)] <- 'Healthy' metadata$Cytogenetics[seq(5,21,1)] <- 'NK' metadata$Cytogenetics[seq(22,23,1)] <- 'Abnormal' > >s metadata$Cytogenetics[seq(1,4,1)] <- 'Healthy' Error in `$<-.data.frame`(`*tmp*`, Cytogenetics, value = c("Healthy", : > > replacement has 4 rows, data has 23 Im trying to add other metadata information based on clinical information apart from giving sample labeling , im certainly doing something wrong but im not sure what it is. As my idea is the another column named Cytogenetics which would have respective information status but im getting that error. [1]: https://drive.google.com/open?id=1BNfxuEuagZ0BSjMAN24cTIbIDxtBpBSg