So I have this data frame
df <- data.frame( A=1:10, B=LETTERS[1:10], C=letters[1:10], stringsAsFactors= F )
I want to add a row to this
Here's an alternative base version that preserves the datatypes.
new.row <- head(df[NA,], 1) new.row[c('A', 'B')] <- list(A=11, B='K') rbind(df, new.row)