Create Data Frame with Column Names in R (4 Examples) | Construct & Make | From Scratch & Matrix
Автор: Statistics Globe
Загружено: 2022-11-14
Просмотров: 868
Описание:
How to make a data frame with column names in the R programming language. More details: https://statisticsglobe.com/create-da...
R code of this video:
data1 <- data.frame(x1 = 10:5, # Create data frame
x2 = letters[1:6],
x3 = "x")
data1 # Print data frame
mat <- matrix(1:15, ncol = 5) # Create matrix
mat # Print matrix
data2 <- as.data.frame(mat) # Create data frame
data2 # Print data frame
data3 <- data2 # Duplicate data frame
colnames(data3) <- paste0("Col_", LETTERS[1:5]) # Create data frame
data3 # Print data frame
data4 <- data.frame(A = numeric(), # Create data frame
B = character(),
C = factor())
data4 # Print data frame
Follow me on Social Media:
Facebook – Statistics Globe Page: / statisticsglobecom
Facebook – R Programming Group for Discussions & Questions: / statisticsglobe
Facebook – Python Programming Group for Discussions & Questions: / statisticsglobepython
LinkedIn – Statistics Globe Page: / statisticsglobe
LinkedIn – R Programming Group for Discussions & Questions: / 12555223
LinkedIn – Python Programming Group for Discussions & Questions: / 12673534
Twitter: / joachimschork
Music by bensound.com
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: