본문 바로가기
R/헬로 데이터과학

R 통계 - 기본 기능(탐색적 분석

by java개발자 2016. 11. 29.

mtcars
#통계
head(mtcars, 10)
summary(mtcars)
class(mtcars)
str(mtcars)
table(mtcars) #Error in table(mtcars) : attempt to make a table with >= 2^31 elements
table(mtcars$cyl)
#그래프
hist(mtcars$cyl)
plot(mtcars$wt, mtcars$mpg)

library(ggplot2)
qplot(wt, mpg, data=mtcars, shape=as.factor(cyl)) #shape
qplot(wt, mpg, data=mtcars, size=cyl)             #size
#factor 범주형 데이터로 변환하기
a <- mtcars
a
a$cyl2 <- as.factor(a$cyl)
summary(a)

############
getwd()

 

 

 

#더 해보기

모든 속성(필드)의 박스모형 출력(일렬로 주욱~

아이리스, 네모난 행렬에 상관도 모형 표시

'R > 헬로 데이터과학' 카테고리의 다른 글

plot(mtcars)  (0) 2016.11.29
R 개요  (0) 2016.11.19
R 자료 from 헬로 데이터 과학  (0) 2016.11.19