我正在努力制作一个 ggvis 图,其中 X 轴文本的字体大小将由滑块控制。现在我收到以下警告:
Warning message:
In toJSON(unclass(x), container, collapse, ..., .level = .level + :
converting an R function to JSON as null. To change this, define a method for toJSON() for a 'function' object.
这是代码:
mivector<-c(1.5,2,2.5,2,2.5,3,2.5,3,3.5)
treats<-c("A","A","A","B","B","B","C","C","C")
library(ggvis)
library(dplyr)
plotdf<-data.frame(mivector,treats)
plotdf %>% ggvis() %>% layer_points(x=~treats,y=~mivector) %>%
add_axis("y",grid=F,title="") %>%
add_axis("x",grid=F,title="",properties=axis_props(labels=list(fontSize=input_slider(min=8,max=20,value=14,label="Font size of the X-axis text"))))
我将非常感谢您的帮助!