-
ggvis package : input_radiobuttons()R 2018. 8. 10. 12:52
ggvis package는 interactive control 기능을 제공한다.
그 기능들은 다음과 같다.
input_checkbox()
input_checkboxgroup()
input_numeric()
input_radiobuttons()
input_select()
input_slider()
input_text()이 중에서 input_radiobuttons()을 이용하여 산점도의 점의 색깔을 변경할 수 있다.
install.packages("tidyverse")
install.packages("ggvis")
library(tidyverse)
library(ggvis)mtcars %>%
ggvis::ggvis(~mpg, ~wt,
fill := input_radiobuttons(label = "Choose color : ",
choices = c("black", "red", "blue", "green"))) %>%
ggvis::layer_points()[참고]
1. https://statkclee.github.io/viz/viz-ggvis.html
2. https://ggvis.rstudio.com/interactivity.html'R' 카테고리의 다른 글
Writing a function has three big advantage (0) 2018.08.24 magrittr 패키지의 tee pipe operator : %T>% (0) 2018.08.24 Relational Data (1) 2018.08.04 readr package (0) 2018.08.03 Data Wrangling (0) 2018.08.03