Rstudio(12) googleVis 패키지

hyukstory 혁스토리·2020년 8월 22일
0

Rstudio

목록 보기
15/16

< 12 > googleVis 패키지

install.packages("googleVis")
library(googleVis)
library(ggplot2)

12-1)

gvisMotionChart(데이터세트, idvar = "기준데이터", timevar = "날짜 데이터")

gvisMotionChart() 함수로 얻은 결과 값으로 그래프를 그려주는 plot() 함수를 이용해 호출해야 함.

#### 날짜별(date) 개인 저축률의 변화(pasvert) 값을 구한 후 motion 변수에 할당

str(economics)
motion <- gvisMotionChart(economics, idvar="psavert", timevar = "date")
plot(motion)                         # motion 변수의 값으로 그래프 그리기

str(CityPopularity)
head(CityPopularity)

12-2)

gvisGauge(데이터 세트, lavelvar = "측정 데이터", numvar = "값", options = list(그래프옵션))

## 게이지의 측정 데이터(labelvar)는 도시명, 값(numvar)은 인구수, 눈금은 0~1000으로 옵션 지정

gauge <- gvisGauge(CityPopularity, labelvar="City", numvar="Popularity", options=list(min=0, max=1000))
plot(gauge)        # gauge 변수 값으로 그래프 그리기
profile
문돌이의 고군분투 개발 공부

0개의 댓글