Heres my data:
> data Manufacturers Models 1 Audi RS5 2 BMW M3 3 Cadillac CTS-V 4 Lexus
this function would improve and solve your problem:
INSERT_NA_ROW <- function(indice, tabla) { new_Row <- NA long <- NROW(tabla) new_Data<- rbind(tabla[1:indice,], new_Row ,tabla[(indice + 1):(long),]) return(new_Data) } # Insert Row in index of dataframe
Thanks for read me!