r get name of column in data frame
colnames(<dataframe>)
#or
names(<dataframe>)
r get name of column in data frame
colnames(<dataframe>)
#or
names(<dataframe>)
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us