R语言基础(二)
2019-07-10 本文已影响0人
见龙在田007er2770
对象
1. 数据的类型与结构
1.1 数据的结构
Homogeneous | Heterogeneous | |
---|---|---|
1d | vector | list |
2d | matrice | data.frame |
3d | array |
1.2 原子数据的类型
atomic vector包括 char\ integer\ double\ logical\ complex\ raw
.
2. 数据的属性
2.1 Property(属性)的定义
atomic vector and list have 3 common properties: type length and attributes.
Type,
typeof()
, what it is.
Length,
length()
, how many elements it contains.
Attributes,
attributes()
, additional arbitrary metadata.
2.2 three most important Attributes
Names, a character vector giving each element a name.
Dimensions, used to turn vectors into matrices and arrays.
Class, used to implement the S3 object system.
PS: 对象(object)的界面(interface)就是属性(properties)和方法(method)。
来自《自学是门手艺--class》