Answers for "how to create dataframe column name in r"

R
1

create a dataframe with column names in r

# This works well if you need an empty dataframe with n known columns
df <- data.frame(matrix(ncol = 3, nrow = 0))
x <- c("name", "age", "gender")
colnames(df) <- x
Posted by: Guest on February-23-2021

Code answers related to "how to create dataframe column name in r"

Browse Popular Code Answers by Language