R language learning notes (1)

Source: Internet
Author: User

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)

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.