cwiczenie 2.txt

(2 KB) Pobierz
R version 2.12.1 (2010-12-16)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> pomiary1<-c(0.6, 0.9, 1.0, 0.9, 1.1, 0.7, 0.9, 0.7, 1.0, 0.8, 0.8)
> pomiary1
 [1] 0.6 0.9 1.0 0.9 1.1 0.7 0.9 0.7 1.0 0.8 0.8
> Pomiary1
Error: object 'Pomiary1' not found
> pomiary<-scan(dec=",")
1: 0,6
2: 0,9
3: 1,0
4: 0,9
5: 1,1
6: 0,7
7: 0,9
8: 0,7
9: 1,0
10: 0,8
11: 0,8
12: 
Read 11 items
> length(pomiary)
[1] 11
> pomiary[1]
[1] 0.6
> pomiary[c(5,3)]
[1] 1.1 1.0
> pomiary[-c(2,3)]
[1] 0.6 0.9 1.1 0.7 0.9 0.7 1.0 0.8 0.8
> 4:7
[1] 4 5 6 7
> pomiary[4:7]
[1] 0.9 1.1 0.7 0.9
> czesc.pomiarow<-pomiary[2:9]
> pomiary<-c(pomiary,0.8)
> pomiary
 [1] 0.6 0.9 1.0 0.9 1.1 0.7 0.9 0.7 1.0 0.8 0.8 0.8
> pomiary[pomiary>0.8]
[1] 0.9 1.0 0.9 1.1 0.9 1.0
> length(pomiary[pomiary>0.8])
[1] 6
> sum(pomiary)
[1] 10.2
> table(pomiary)
pomiary
0.6 0.7 0.8 0.9   1 1.1 
  1   2   3   3   2   1 
> mean(pomiary)
[1] 0.85
> sd(pomiary)
[1] 0.1445998
> var(pomiary)
[1] 0.02090909
> sd(pomiary)/mean(pomiary)
[1] 0.1701174
> v<-sd(pomiary)/mean(pomiary)
> v
[1] 0.1701174
> v*100
[1] 17.01174
> wsp.zm.<-function(dane){ 
+ srednia<-mean(dane)
+ odchylenie<-sd(dane)
+ V<-odchylenie/srednia
+ V}
> wsp.zm.(dane=pomiary)
[1] 0.1701174
> summary(pomiary)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  0.600   0.775   0.850   0.850   0.925   1.100 
> quantile(pomiary)
   0%   25%   50%   75%  100% 
0.600 0.775 0.850 0.925 1.100 
> sort(pomiary)
 [1] 0.6 0.7 0.7 0.8 0.8 0.8 0.9 0.9 0.9 1.0 1.0 1.1
> ?sort
starting httpd help server ... done
> stem(pomiary)

  The decimal point is 1 digit(s) to the left of the |

   6 | 000
   8 | 000000
  10 | 000

> stem(pomiary,scale=2)

  The decimal point is 1 digit(s) to the left of the |

   6 | 0
   7 | 00
   8 | 000
   9 | 000
  10 | 00
  11 | 0

> stem(pomiary,scale=0.5)

  The decimal point is at the |

  0 | 677888999
  1 | 001

> boxplot(pomiary)

> boxplot(pomiary,ylim=c(0,1.4))
> boxplot(pomiary,ylim=c(0,1.2),horizontal=T)
 
Zgłoś jeśli naruszono regulamin