프로그래밍/Big Data
R을 이용한 Visualization: tabplot, googleVis, ggplot2
삶의 재발견
2014. 2. 5. 06:45
반응형
R에서 tabplot, googleVis, ggplot2 등의 Package를 활용해서 다양한 그래프를 작성할 수 있습니다.
■ tabplot
install.packages("ggplot2")
library(ggplot2)
data(diamonds)
install.packages("tabplot")
library(tabplot)
tableplot(diamonds)
■ googleVis
#googleVis 예제: 움직이는 그래프를 생성해줌
install.packages("googleVis")
library(googleVis)
data(Fruits)
head(Fruits)
M2 <- gvisMotionChart(Fruits, idvar="Fruit", timevar="Date", date.format="%Y%m%d")
plot(M2)
다음과 같이 웹브라우저 안에서 동적인 그래프를 생성해서 보여줍니다.
■ ggplot2 사용
install.packages("ggplot2")
library(ggplot2)
ggplot(ChickWeight, aes(x=Time, y=weight, colour=Diet, group=Chick))+geom_line()
추가 관련 Source는 아래 파일 참조하시면 됩니다.
지도관련해서는 ggmap 패키지 활용하면 됩니다.
반응형