R Language Learning Notes

Source: Internet
Author: User

1. Part of the intercepted data

In statistical analysis, if you want to use part of the observational data for the calculation analysis, what should be done?

One way to do this is to intercept the index range using a similar access to the array index, for example, take the first 6 values for a set of CPU utilization data:

> cpu1 [1]   0.0   0.0   0.0   0.0   0.0   6.1   3.0  10.5-10.6  -1.4   5.9   0.1[13 ]   9.0-15.1  -1.5   6.1   7.5  -6.0  -3.1   9.2  -6.2   3.1  -1.5   3.0 [+]  -2.9   4.4  -7.5  10.4-15.0   4.6  -4.5  15.0-10.5  -4.6   9.0   1.6[37]  -1.5  -4.5   4.6  -3.1   4.5  -7.6  16.7-21.2  15.1   4.6-13.6   3.1[49]  -1.7   3.1  -4.6   0.0  24.3-21.3  -2.9  12.1  -4.6  -4.6  -5.8   3.0[61]  -3.0  -9.2   7.4   9.2   0.2  -7.7  15.2-18.3  12.1  -1.5  -6.1   1.6[73]   0.0  -1.5   3.2  -1.7  -3.0  12.2  -1.7  -9.0  -3.1  -1.5   7.5   3.1[85]   3.0  -0.2  -2.8   0.0   2.9   4.7  -5.9   4.4  -4.6  -6.1   0.3-12.3> cpu1[1:6][1] 0.0 0.0 0.0 0.0 0.0 6.1> cpu1[0:6][1] 0.0 0.0 0.0 0.0 0.0 6.1


R Language Learning Notes

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.