ibinom(0.5, size = 7, prob = 0.4,)
 set.seed(8675309)
 ibinom(runif(10), 10, 0.3, showPMF = TRUE)
 set.seed(8675309)
 ibinom(runif(10), 10, 0.3, showECDF = TRUE)
 set.seed(8675309)
 ibinom(runif(10), 10, 0.3, showPMF = TRUE, showECDF = TRUE, sampleColor = "blue3")
 set.seed(8675309)
 ibinom(runif(10), 10, 0.3, showPMF = TRUE, showCDF = FALSE)
 ibinom(runif(100), 10, 0.3, showPMF = TRUE, minPlotQuantile = 0.02, maxPlotQuantile = 0.98)
 # plot the PMF and CDF without any variates
 ibinom(NULL, 10, 0.3, showPMF = TRUE, showCDF = TRUE)
 # plot CDF with inversion and PMF using show
 ibinom(runif(10), 10, 0.3, show = c(1,1,0))
 ibinom(runif(10), 10, 0.3, show = 6)
 # plot CDF with inversion and ECDF using show, using vunif
 ibinom(vunif(10), 10, 0.3, show = c(1,0,1))
 ibinom(vunif(10), 10, 0.3, show = 5)
 # plot CDF with inversion, PMF, and ECDF using show
 ibinom(vunif(10), 10, 0.3, show = c(1,1,1))
 ibinom(vunif(10), 10, 0.3, show = 7)
 # plot three different CDF+PMF+ECDF horizontal displays,
 # with title only on the first display
 oldpar <- par(no.readonly = TRUE)
 par(mfrow = c(3,3))  # 3 rows, 3 cols, filling rows before columns
 set.seed(8675309)
 ibinom(runif(20), 10, 0.3, show = 7, respectLayout = TRUE, restorePar = FALSE)
 ibinom(runif(20), 10, 0.3, show = 7, respectLayout = TRUE, restorePar = FALSE, showTitle = FALSE)
 ibinom(runif(20), 10, 0.3, show = 7, respectLayout = TRUE, restorePar = TRUE,  showTitle = FALSE)
 par(oldpar)
 # display animation of all components
 ibinom(runif(10), 10, 0.3, show = 7, plotDelay = 0.1)
 # display animation of CDF and PMF components only
 ibinom(runif(10), 10, 0.3, show = 5, plotDelay = 0.1)
 if (interactive()) {
   # interactive -- pause at each stage of inversion
   ibinom(runif(10), 10, 0.3, show = 7, plotDelay = -1)
 }
Run the code above in your browser using DataLab