Data frame can be understood as what we often call “table”.
Data frame is the data structure of R language and a special two-dimensional list.
Each column of the data frame has a unique column name with equal length. The data types of the same column need to be consistent, and the data types of different columns can be different.
#===Create a data frame===
table = data.frame(
姓名 = c("小明", "小红"),
工号 = c("1","2"),
月薪 = c(10000, 20000)
)
#---View table data---
print(table)
#---Get data structure
str(table)
# Display summary
print(summary(table))
Result output