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