Insert New Column Between Two Data Frame Variables in R (2 Examples) | add_column Function of tibble

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

x2 = letters[1:5],
x3 = 4)

new_col <- c(7, 1, 4, 3, 6) # New column vector
new_col # Print column vector

library("tibble")

data_new1 <- add_column(data, new_col, .after = 1) # Apply add_column function by index

data_new2 <- add_column(data, new_col, .after = "x1") # Apply add_column function by name

Follow me on Social Media:
Рекомендации по теме
Комментарии
Автор

Great video for newbies like me, thanks!

monkeyofwar
visit shbcf.ru