对如下数据进行描述性分析,其中包括:最大值,最小值,中位数,众数等,求表的行数、列数。
> mydata<-read.csv("C:\\Users\\adwar\\Desktop\\soapdata.csv")
求表的行数:
> nrow(mynewdata)
[1] 39
求表的列数:
> ncol(mynewdata)
[1] 18
> a<-mynewdata$播放天数
> a
[1] NA NA 31 22 23 66 14 31 31 27 29 27 25 31 30 31 39 30 24
[20] 22 28 33 24 45 16 22 25 27 22 25 22 22 23 30 36 20 21 37
[39] 25 23 40 NA NA NA NA NA NA NA NA NA NA NA NA
> newa<-na.omit(a)
> newa
[1] 31 22 23 66 14 31 31 27 29 27 25 31 30 31 39 30 24 22 28
[20] 33 24 45 16 22 25 27 22 25 22 22 23 30 36 20 21 37 25 23
[39] 40
> max(newa)
[1] 66
> min(newa)
[1] 14
> round(mean(newa))
[1] 28
> median(newa)
[1] 27
> names(table(newa))[which.max(table(newa))]
[1] "22"
> var(newa)
[1] 79.99325
> sd(newa)
[1] 8.943895
> b<-mydata$收视率
> b
[1] 1.1280 1.1840 1.5760 0.7830 0.7850 0.8350 0.9380 3.6610
[9] 1.0480 0.9400 0.7132 1.9300 0.8770 1.1670 1.2880 0.4860
[17] 1.3140 0.9820 1.2290 1.2300 1.4900 1.1800 0.8900 1.7100
[25] 0.9300 0.9400 1.1800 1.6400 1.1800 2.0400 1.2200 1.2200
[33] 1.1000 1.1400 0.9700 0.9100 1.0600 1.0000 1.3000 1.4100
[41] 2.9100 NA NA NA NA NA NA NA
[49] NA NA NA NA NA
> newb<-na.omit(b)
> newb
[1] 1.1280 1.1840 1.5760 0.7830 0.7850 0.8350 0.9380 3.6610
[9] 1.0480 0.9400 0.7132 1.9300 0.8770 1.1670 1.2880 0.4860
[17] 1.3140 0.9820 1.2290 1.2300 1.4900 1.1800 0.8900 1.7100
[25] 0.9300 0.9400 1.1800 1.6400 1.1800 2.0400 1.2200 1.2200
[33] 1.1000 1.1400 0.9700 0.9100 1.0600 1.0000 1.3000 1.4100
[41] 2.9100
> max(newb)
[1] 3.661
> min(newb)
[1] 0.486
> mean(newb)
[1] 1.256444
> median(newb)
[1] 1.167
> names(table(newb))[which.max(table(newb))]
[1] "1.18"
> var(newb)
[1] 0.3209224
> sd(newb)
[1] 0.5665001
> c<-mydata$网络播放量.亿.
>c
[1] 21.4 92.9 237.8 17.4 74.3 69.2 52.9 302.4 14.5
[10] 49.1 52.9 85.4 11.9 46.4 410.5 57.4 188.2 83.2
[19] 79.5 91.4 251.3 80.0 85.8 110.6 203.7 75.2 86.6
[28] 64.7 148.9 101.5 42.5 207.3 17.6 110.8 14.2 4.0
[37] 4.9 41.9 78.6 37.0 264.8 NA NA NA NA
[46] NA NA NA NA NA NA NA NA
> newc<-na.omit(c)
> newc
[1] 21.4 92.9 237.8 17.4 74.3 69.2 52.9 302.4 14.5
[10] 49.1 52.9 85.4 11.9 46.4 410.5 57.4 188.2 83.2
[19] 79.5 91.4 251.3 80.0 85.8 110.6 203.7 75.2 86.6
[28] 64.7 148.9 101.5 42.5 207.3 17.6 110.8 14.2 4.0
[37] 4.9 41.9 78.6 37.0 264.8
> max(newc)
[1] 410.5
> min(newc)
[1] 4
> mean(newc)
[1] 99.28293
> median(newc)
[1] 78.6
> names(table(newc))[which.max(table(newc))]
[1] "52.9"
> var(newc)
[1] 8191.57
> sd(newc)
[1] 90.5073
> d<-mydata$可见弹幕数
> d
[1] 523749.00 1666971.00 3952034.00 390280.00 1602817.00
[6] 871015.00 1015972.00 4520483.00 383356.00 1079913.00
[11] 571716.00 25122.34 850278.00 959334.00 8199705.00
[16] 1832970.00 658196.00 1980935.00 1162211.00 1064108.00
[21] 3212744.00 769342.00 1114648.00 2141146.00 993456.00
[26] 1281756.00 1285431.00 994242.00 2520841.00 403134.00
[31] 320279.00 3201981.00 348560.00 997472.00 381561.00
[36] 127588.00 58571.00 652281.00 500105.00 914847.00
[41] 1291142.00 NA NA NA NA
[46] NA NA NA NA NA
[51] NA NA NA
> newd<-na.omit(d)
> newd
[1] 523749.00 1666971.00 3952034.00 390280.00 1602817.00
[6] 871015.00 1015972.00 4520483.00 383356.00 1079913.00
[11] 571716.00 25122.34 850278.00 959334.00 8199705.00
[16] 1832970.00 658196.00 1980935.00 1162211.00 1064108.00
[21] 3212744.00 769342.00 1114648.00 2141146.00 993456.00
[26] 1281756.00 1285431.00 994242.00 2520841.00 403134.00
[31] 320279.00 3201981.00 348560.00 997472.00 381561.00
[36] 127588.00 58571.00 652281.00 500105.00 914847.00
[41] 1291142.00
> max(newd)
[1] 8199705
> min(newd)
[1] 25122.34
> mean(newd)
[1] 1385910
> median(newd)
[1] 994242
> names(table(newd))[which.max(table(newd))]
[1] "25122.34"
> var(newd)
[1] 2.223309e+12
> sd(newd)
[1] 1491077
> e<-mydata$视频网站总评论数
> e
[1] 204172 474344 1243220 118268 218122 549517 147691
[8] 492970 66268 156509 101593 391934 64019 205821
[15] 2351795 349208 711652 730880 200662 418806 964734
[22] 180304 256088 564411 1205515 481528 395785 232258
[29] 515005 779238 77288 1097082 98112 322887 128603
[36] 41128 24446 226313 2049235 254907 2317520 NA
[43] NA NA NA NA NA NA NA
[50] NA NA NA NA
> newe<-na.omit(e)
> newe
[1] 204172 474344 1243220 118268 218122 549517 147691
[8] 492970 66268 156509 101593 391934 64019 205821
[15] 2351795 349208 711652 730880 200662 418806 964734
[22] 180304 256088 564411 1205515 481528 395785 232258
[29] 515005 779238 77288 1097082 98112 322887 128603
[36] 41128 24446 226313 2049235 254907 2317520
> max(newe)
[1] 2351795
> min(newe)
[1] 24446
> mean(newe)
[1] 522191.2
> median(newe)
[1] 322887
> names(table(newe))[which.max(table(newe))]
[1] "24446"
> var(newe)
[1] 338833639743
> sd(newe)
[1] 582094.2
> f<-mydata$相关微博数.万.
> f
[1] 37.1000 28.4000 55.0000 2.9000 13.8000 12.0000
[7] 11.1000 39.5000 0.3564 3.3000 3.1000 367.1000
[13] 1.9000 1.2000 163.3000 40.5000 39.6000 21.1000
[19] 4.0000 7.4000 7.1000 0.6475 13.7000 12.5000
[25] 9.6000 1.4000 3.0000 9.8000 3.4000 1.1000
[31] 0.5454 78.5000 0.0768 0.4118 0.1765 1.6000
[37] 0.2335 0.5264 0.6820 0.0826 0.1028 NA
[43] NA NA NA NA NA NA
[49] NA NA NA NA NA
> newf<-na.omit(f)
> newf
[1] 37.1000 28.4000 55.0000 2.9000 13.8000 12.0000
[7] 11.1000 39.5000 0.3564 3.3000 3.1000 367.1000
[13] 1.9000 1.2000 163.3000 40.5000 39.6000 21.1000
[19] 4.0000 7.4000 7.1000 0.6475 13.7000 12.5000
[25] 9.6000 1.4000 3.0000 9.8000 3.4000 1.1000
[31] 0.5454 78.5000 0.0768 0.4118 0.1765 1.6000
[37] 0.2335 0.5264 0.6820 0.0826 0.1028
> max(newf)
[1] 367.1
> min(newf)
[1] 0.0768
> mean(newf)
[1] 24.3376
> median(newf)
[1] 3.4
> names(table(newf))[which.max(table(newf))]
[1] "0.0768"
> var(newf)
[1] 3872.535
> sd(newf)
[1] 62.22969
> g<-mydata$微博相关话题讨论量.万.
> g
[1] 402.5000 275.7000 386.2000 24.8000 91.8000 73.9000
[7] 29.4000 215.8000 1.9000 10.2000 14.9000 108.2000
[13] 15.1000 10.3000 985.5000 304.1000 250.1000 125.2000
[19] 17.7000 27.6000 41.7000 1.9000 26.4000 39.7000
[25] 52.8000 7.6000 3.3000 36.0000 8.1000 9.2000
[31] 3.2000 588.9000 0.0770 3.9000 0.3682 0.0849
[37] 0.3995 2.0000 6.1000 1.6000 1.3000 NA
[43] NA NA NA NA NA NA
[49] NA NA NA NA NA
> newg<-na.omit(g)
> newg
[1] 402.5000 275.7000 386.2000 24.8000 91.8000 73.9000
[7] 29.4000 215.8000 1.9000 10.2000 14.9000 108.2000
[13] 15.1000 10.3000 985.5000 304.1000 250.1000 125.2000
[19] 17.7000 27.6000 41.7000 1.9000 26.4000 39.7000
[25] 52.8000 7.6000 3.3000 36.0000 8.1000 9.2000
[31] 3.2000 588.9000 0.0770 3.9000 0.3682 0.0849
[37] 0.3995 2.0000 6.1000 1.6000 1.3000
> max(newg)
[1] 985.5
> min(newg)
[1] 0.077
> mean(newg)
[1] 102.5739
> median(newg)
[1] 17.7
> names(table(newg))[which.max(table(newg))]
[1] "1.9"
> var(newg)
[1] 38206.95
> sd(newg)
[1] 195.466
> h<-mydata$微博总点赞量.万.
> h
[1] 1100.0000 1700.0000 1700.0000 114.5000 285.0000
[6] 243.8000 110.6000 678.1000 2.6000 41.9000
[11] 27.7000 2300.0000 25.0000 8.2000 7.1000
[16] 1100.0000 958.5000 528.9000 22.1000 418.5000
[21] 68.4000 2.3000 88.9000 96.5000 137.9000
[26] 14.7000 15.3000 108.2000 21.3000 9.7000
[31] 6.1000 0.2200 0.2891 5.2000 0.7307
[36] 0.4521 0.7925 2.5000 10.4000 2.6000
[41] 3.0000 NA NA NA NA
[46] NA NA NA NA NA
[51] NA NA NA
> newh<-na.omit(h)
> newh
[1] 1100.0000 1700.0000 1700.0000 114.5000 285.0000
[6] 243.8000 110.6000 678.1000 2.6000 41.9000
[11] 27.7000 2300.0000 25.0000 8.2000 7.1000
[16] 1100.0000 958.5000 528.9000 22.1000 418.5000
[21] 68.4000 2.3000 88.9000 96.5000 137.9000
[26] 14.7000 15.3000 108.2000 21.3000 9.7000
[31] 6.1000 0.2200 0.2891 5.2000 0.7307
[36] 0.4521 0.7925 2.5000 10.4000 2.6000
[41] 3.0000
> max(newh)
[1] 2300
> min(newh)
[1] 0.22
> mean(newh)
[1] 102.5739
> median(newh)
[1] 17.7
> names(table(newh))[which.max(table(newh))]
[1] "1.9"
> var(newh)
[1] 38206.95
> sd(newh)
[1] 195.466
> i<-mydata$微博总转发量.万.
> i
[1] 8.741e+02 1.000e+03 5.824e+02 2.980e+01 1.380e+02
[6] 1.051e+02 5.700e+01 3.393e+02 1.800e+00 1.320e+01
[11] 3.170e+01 8.900e+03 3.090e+01 5.100e+00 1.200e+04
[16] 5.990e+02 5.214e+02 2.331e+02 4.130e+01 1.802e+02
[21] 7.250e+01 2.000e+00 5.100e+01 5.270e+01 1.113e+02
[26] 8.400e+00 2.300e+00 8.770e+01 1.570e+01 6.800e+00
[31] 2.700e+00 7.937e+02 4.700e-02 5.300e+00 1.436e-01
[36] 1.396e-01 2.435e-01 2.500e+00 1.030e+01 6.617e-01
[41] 2.600e+00 NA NA NA NA
[46] NA NA NA NA NA
[51] NA NA NA
> newi<-na.omit(i)
> newi
[1] 8.741e+02 1.000e+03 5.824e+02 2.980e+01 1.380e+02
[6] 1.051e+02 5.700e+01 3.393e+02 1.800e+00 1.320e+01
[11] 3.170e+01 8.900e+03 3.090e+01 5.100e+00 1.200e+04
[16] 5.990e+02 5.214e+02 2.331e+02 4.130e+01 1.802e+02
[21] 7.250e+01 2.000e+00 5.100e+01 5.270e+01 1.113e+02
[26] 8.400e+00 2.300e+00 8.770e+01 1.570e+01 6.800e+00
[31] 2.700e+00 7.937e+02 4.700e-02 5.300e+00 1.436e-01
[36] 1.396e-01 2.435e-01 2.500e+00 1.030e+01 6.617e-01
[41] 2.600e+00
> max(newi)
[1] 12000
> min(newi)
[1] 0.047
> mean(newi)
[1] 656.3935
> median(newi)
[1] 31.7
> names(table(newi))[which.max(table(newi))]
[1] "0.047"
> var(newi)
[1] 5229504
> sd(newi)
[1] 2286.811
> j<-mydata$百度指数
> j
[1] 653475 927529 212789 7243 25229 313109 25028 114236
[9] 6264 4513 31652 23157 5013 2323 82014 31470
[17] 7274 9713 2303 2402 12387 1861 4329 5408
[25] 33292 4374 5682 2894 6462 5917 2083 135760
[33] 1283 5557 1806 397 673 1427 2508 1056
[41] 10288 NA NA NA NA NA NA NA
[49] NA NA NA NA NA
> newj<-na.omit(j)
> newj
[1] 653475 927529 212789 7243 25229 313109 25028 114236
[9] 6264 4513 31652 23157 5013 2323 82014 31470
[17] 7274 9713 2303 2402 12387 1861 4329 5408
[25] 33292 4374 5682 2894 6462 5917 2083 135760
[33] 1283 5557 1806 397 673 1427 2508 1056
[41] 10288
> max(newj)
[1] 927529
> min(newj)
[1] 397
> mean(newj)
[1] 66638.54
> median(newj)
[1] 5917
> names(table(newj))[which.max(table(newj))]
[1] "397"
> var(newj)
[1] 32312314828
> sd(newj)
[1] 179756.3
> k<-mydata$X360指数
> k
[1] 3398052 9938557 2312858 18678 83709 4069221 28766
[8] 676408 13683 25892 19779 39121 9212 5845
[15] 189618 32696 12493 9314 2269 2164 14020
[22] 1356 12211 7893 176718 6864 15007 83575
[29] 10466 7430 2161 2583514 556 12991 2088
[36] 126 134 1226 1932 1646 16126 NA
[43] NA NA NA NA NA NA NA
[50] NA NA NA NA
> newk<-na.omit(k)
> newk
[1] 3398052 9938557 2312858 18678 83709 4069221 28766
[8] 676408 13683 25892 19779 39121 9212 5845
[15] 189618 32696 12493 9314 2269 2164 14020
[22] 1356 12211 7893 176718 6864 15007 83575
[29] 10466 7430 2161 2583514 556 12991 2088
[36] 126 134 1226 1932 1646 16126
> max(newk)
[1] 9938557
> min(newk)
[1] 126
> mean(newk)
[1] 581618.9
> median(newk)
[1] 12991
> names(table(newk))[which.max(table(newk))]
[1] "126"
> var(newk)
[1] 3.139499e+12
> sd(newk)
[1] 1771863
> l<-mydata$新闻收录量
> l
[1] 13200 5230 61700 1480 8240 35900 3600 78900
[9] 282 3360 3560 8420 1230 692 69400 15000
[17] 8630 4200 2130 285 21700 10800 19600 41300
[25] 31100 6780 1810 264000 164000 8830 4730 124000
[33] 4090 13500 2850 1160 69100 3880 15500 3940
[41] 92700 NA NA NA NA NA NA NA
[49] NA NA NA NA NA
> newl<-na.omit(l)
> newl
[1] 13200 5230 61700 1480 8240 35900 3600 78900
[9] 282 3360 3560 8420 1230 692 69400 15000
[17] 8630 4200 2130 285 21700 10800 19600 41300
[25] 31100 6780 1810 264000 164000 8830 4730 124000
[33] 4090 13500 2850 1160 69100 3880 15500 3940
[41] 92700
> max(newl)
[1] 264000
> min(newl)
[1] 282
> mean(newl)
[1] 30019.73
> median(newl)
[1] 8420
> names(table(newl))[which.max(table(newl))]
[1] "282"
> var(newl)
[1] 2737539284
> sd(newl)
[1] 52321.5
> m<-mydata$豆瓣评分
> m
[1] 4.3 5.5 5.2 5.0 7.5 9.0 6.6 8.3 2.8 6.5 8.2 4.6 8.5 3.0
[15] 6.4 6.9 3.1 4.7 4.7 4.5 4.8 5.3 5.7 6.3 5.1 7.8 3.9 4.7
[29] 6.6 5.0 6.9 7.3 5.5 3.3 3.4 4.4 3.7 6.3 6.1 5.3 5.2 NA
[43] NA NA NA NA NA NA NA NA NA NA NA
> newm<-na.omit(m)
> newm
[1] 4.3 5.5 5.2 5.0 7.5 9.0 6.6 8.3 2.8 6.5 8.2 4.6 8.5 3.0
[15] 6.4 6.9 3.1 4.7 4.7 4.5 4.8 5.3 5.7 6.3 5.1 7.8 3.9 4.7
[29] 6.6 5.0 6.9 7.3 5.5 3.3 3.4 4.4 3.7 6.3 6.1 5.3 5.2
> max(newm)
[1] 9
> min(newm)
[1] 2.8
> mean(newm)
[1] 5.558537
> median(newm)
[1] 5.3
> names(table(newm))[which.max(table(newm))]
[1] "4.7"
> var(newm)
[1] 2.518488
> sd(newm)
[1] 1.586974
> n<-mydata$豆瓣评价人数
> n
[1] 12917 24310 44886 1284 36407 32357 7108 159558
[9] 878 7823 11813 5266 20260 1953 80309 45638
[17] 44905 11465 4712 12498 27132 6354 14630 28895
[25] 65386 19087 2107 4754 22457 18487 5858 95287
[33] 1586 4235 330 110 253 3249 20935 2792
[41] 54049 NA NA NA NA NA NA NA
[49] NA NA NA NA NA
> newn<-na.omit(n)
> newn
[1] 12917 24310 44886 1284 36407 32357 7108 159558
[9] 878 7823 11813 5266 20260 1953 80309 45638
[17] 44905 11465 4712 12498 27132 6354 14630 28895
[25] 65386 19087 2107 4754 22457 18487 5858 95287
[33] 1586 4235 330 110 253 3249 20935 2792
[41] 54049
> max(newn)
[1] 159558
> min(newn)
[1] 110
> mean(newn)
[1] 23520
> median(newn)
[1] 12498
> names(table(newn))[which.max(table(newn))]
[1] "110"
> var(newn)
[1] 983201853
> sd(newn)
[1] 31356.05