R language learning notes (1) -- data in R
1. Common objects (objects) in R include:
1. Vector)
2. factor is a classification variable.
3. array is a K-dimensional data table. All elements must be of the same type.
4. Matrix is a special case of arrays, where k = 2
5. A data frame is composed of one or more vectors and (or) factors. They must be of the same length, but can be of different data types.
6. Time Series (TS), including some additional attributes, such as time and frequency
7. List, which can contain any type of Objects
2. Two internal attributes of an object:
1. Type (mode), indicating the type of X: mode (X)
2. Length)
For a vector, its type and length are enough to describe the data. For other objects, additional information is provided by the external attribute, and attribute () is used () method to call its additional properties.
Iii. Common Data Types
1. numeric type (numeric)
2. character (character)
3. Complex)
4. Logical (logical) (false/true)
You can use the AS. Something () method to convert data types,
For example, Z = 0.9; digits = As. character (z); A = As. Numeric (digits)