Knižnice

# install.packages("ggplot2")
library(ggplot2)
# require(ggplot2)
# install.packages("GGally")
library(GGally)
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2

Deskriptívne štatistiky a exploratórna analýza

Ex1014 <- read.csv("http://www.karlin.mff.cuni.cz/~pesta/NMFM334/cvicenie/Ex1014.txt", header = TRUE, sep = " ")
Ex1014
##    copper zinc protein
## 1     0.0    0     201
## 2     0.0  375     186
## 3     0.0  750     173
## 4     0.0 1125     110
## 5     0.0 1500     115
## 6    37.5    0     202
## 7    37.5  375     161
## 8    37.5  750     172
## 9    37.5 1125     138
## 10   37.5 1500     133
## 11   75.0    0     204
## 12   75.0  375     165
## 13   75.0  750     148
## 14   75.0 1125     143
## 15   75.0 1500     123
## 16  112.5    0     188
## 17  112.5  375     172
## 18  112.5  750     157
## 19  112.5 1125     115
## 20  112.5 1500     108
## 21  150.0    0     133
## 22  150.0  375     125
## 23  150.0  750     184
## 24  150.0 1125     135
## 25  150.0 1500     114
summary(Ex1014)
##      copper           zinc         protein     
##  Min.   :  0.0   Min.   :   0   Min.   :108.0  
##  1st Qu.: 37.5   1st Qu.: 375   1st Qu.:125.0  
##  Median : 75.0   Median : 750   Median :148.0  
##  Mean   : 75.0   Mean   : 750   Mean   :152.2  
##  3rd Qu.:112.5   3rd Qu.:1125   3rd Qu.:173.0  
##  Max.   :150.0   Max.   :1500   Max.   :204.0
dim(Ex1014)
## [1] 25  3
pairs(Ex1014)

ggpairs(Ex1014)

cor(Ex1014)
##             copper       zinc    protein
## copper   1.0000000  0.0000000 -0.2350643
## zinc     0.0000000  1.0000000 -0.7755271
## protein -0.2350643 -0.7755271  1.0000000
hgram<-ggplot(Ex1014, aes(x=protein)) + geom_histogram()
hgram
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.