简体   繁体   中英

CDF - GoogleVis command for Cumulative Distribution plot

有人知道我可以用来绘制累积分布函数(CDF)的GoogleVis软件包中的哪些命令/函数吗?

From the journal article here ,

The googleVis package provides an interface between R and the Google Visualisation API. The functions of the package allow the user to visualise data stored in R data frames with the Google Visualisation API.

You need to generate a data frame of the CDF for your PDF such as this example for dnorm :

xlist<-seq(-5,5,0.01)
ylist<-numeric()
for (x in xlist) {
  ylist<-append(ylist,integrate(dnorm,-Inf,x)$value)
}
df<-data.frame(xlist,ylist)

I'm not sure what googleVis buys you for visualization of this function beyond a simple plot:

plot(df)

or in one line:

plot(Vectorize(function(X)integrate(dnorm,-5,X)$value),-5,5,add=TRUE)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM