Add Empty Row to Data Frame in R (Example) | nrow() Function | How to Append NA Values in New Line

preview_player
Показать описание
R code of this video:

x2 = 4:1,
x3 = letters[1:4])
data # Print example data frame

data_new <- data # Create duplicate of example data frame
data_new[nrow(data_new) + 1, ] <- NA # Add empty row containing only NA values
data_new # Print new data frame

Follow me on Social Media:

Рекомендации по теме
Комментарии
Автор

Great content!
Could you please make a video about a function for repetitive tasks? For example, if one is interested in creating graphs (or another task) by multiple geographies (character varible with various city/state names). Instead of repeating the same script numerous times, a function will be more efficient. Thanks in advance and please keep up the great work you do on the channel.

moezandy
visit shbcf.ru