R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

#4-1
score <- c(90, 85, 73, 80, 85, 65, 78, 50, 68, 96)
names(score) <- c('KOR', 'ENG', 'ATH', 'HIST', 'SOC', 'MUSIC', 'BIO', 'EARTH', 'PHY', 'ART')

#4-2
score
##   KOR   ENG   ATH  HIST   SOC MUSIC   BIO EARTH   PHY   ART 
##    90    85    73    80    85    65    78    50    68    96
#4-3
mean(score)
## [1] 77
median(score)
## [1] 79
#4-4
sd(score)
## [1] 13.49074
#4-5
which.max(score)
## ART 
##  10
#4-6
boxplot(score)

#4-7
hist(score,
     main = "학생 성적",
     col = "purple")

#5-1
mtcars
mean(mtcars$wt)
## [1] 3.21725
median(mtcars$wt)
## [1] 3.325
mean(mtcars$wt, trim=0.15)
## [1] 3.165208
sd(mtcars$wt)
## [1] 0.9784574
#5-2
summary(mtcars$wt)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.513   2.581   3.325   3.217   3.610   5.424
#5-3
table(mtcars$cyl)
## 
##  4  6  8 
## 11  7 14
a <- table(mtcars$cyl)

#5-4
barplot(a)

#5-5
hist(mtcars$wt)

#5-6
boxplot(mtcars$wt)

boxplot.stats(mtcars$wt)
## $stats
## [1] 1.5130 2.5425 3.3250 3.6500 5.2500
## 
## $n
## [1] 32
## 
## $conf
## [1] 3.015667 3.634333
## 
## $out
## [1] 5.424 5.345
#5-7
boxplot(mtcars$disp)

boxplot.stats(mtcars$disp)
## $stats
## [1]  71.10 120.65 196.30 334.00 472.00
## 
## $n
## [1] 32
## 
## $conf
## [1] 136.7098 255.8902
## 
## $out
## numeric(0)
#5-8
boxplot(mtcars$mpg ~ as.factor(mtcars$gear), 
        xlab = "Gear",
        ylab = "mpg",
        main = "기어수별 연비",
        col = "skyblue",
        border = "black")

#6-1
head(trees)
#6-2
mean(trees$Girth)
## [1] 13.24839
median(trees$Girth)
## [1] 12.9
mean(trees$Girth, trim = 0.15)
## [1] 13.04348
sd(trees$Girth)
## [1] 3.138139
#6-3
hist(trees$Girth)

#6-4
boxplot(trees$Girth)

#6-5
mean(trees$Height)
## [1] 76
median(trees$Height)
## [1] 76
mean(trees$Height, trim = 0.15)
## [1] 76.3913
sd(trees$Height)
## [1] 6.371813
#6-6
hist(trees$Height)

#6-7
boxplot(trees$Height)