I have a list of 52 datasets that are between 5 and 6 rows; they will all need an added column but to add this column the row number needs to be the same. To the sets with 5 rows, I want to add a 6th row with "NA" filling the row as a place holder. Here is where I have started, but I am unsure how to complete the loop because I am unsure what to use for the "df" in the nrow() function. I want this to do nothing to the datasets with 6 rows already.
testrows<-if lapply(listallht_allwk, nrow) = 5 {
df[nrow(df) + 1 ,] <- NA
}