R/헬로 데이터과학

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

java개발자 2016. 11. 29. 14:01

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()

 

 

 

#더 해보기

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

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