2
我真的是ggvis的新手,我在網上搜索沒有成功。
我有這樣一個數據集:
ggvis input_select on scale_numeric trans參數
data.example=data.frame("V1"=c(rep("A",times=10),rep("B",times=10)),"V2"=c(runif(10,1,10000),runif(10,100,1000)))
head(data.example)
V1 V2
1 A 7261.076
2 A 1955.755
3 A 3473.473
4 A 7593.278
5 A 3218.867
6 A 4997.951
tail(data.example)
V1 V2
15 B 721.2147
16 B 185.6676
17 B 939.3541
18 B 276.0682
19 B 910.0322
20 B 444.2188
我可以沿y
data.example %>%
ggvis(x=~V1,y=~V2,fill=~V1) %>%
layer_boxplots() %>%
scale_numeric("y",trans="linear")
做箱線圖與線性度和y中
data.example %>%
ggvis(x=~V1,y=~V2,fill=~V1) %>%
layer_boxplots() %>%
scale_numeric("y",trans="log")
箱線圖與對數刻度我不能用這樣的代碼做座標變換選擇的動態箱形圖:
select.trans=input_select(choices = c("Linear"="linear","Logarithmic"="log"),selected="linear",label="Scale")
data.example %>%
ggvis(x=~V1,y=~V2,fill=~V1) %>%
layer_boxplots() %>%
scale_numeric("y",trans=select.trans,expand=0)
與此錯誤消息:
Error in match(x, table, nomatch = 0L) :
'match' requires vectorial arguments
可能是我忽略了一些重要的東西ggvis?
由於
謝謝!下次我需要仔細閱讀文檔! – 2015-04-09 09:51:00