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



本文详细介绍了R语言中DataFrame的数据结构,包括其二维列表特性、列名唯一且长度一致、数据类型一致性及多样性。通过实例展示了创建DataFrame、查看数据、获取数据结构和数据分析的方法。

357

被折叠的 条评论
为什么被折叠?



