Generic Plotting with 'C3.js'
c3plot.RdThis is a generic function for plotting 'R' objects using the C3.js charting library. The syntax is similar to that of the plot() generic function.
Arguments
- x
x coordinates for points or any 'R' object with a
c3plotmethod.- ...
arguments passed to methods.
Details
For simple scatter and line plots, c3plot.default will be used. However, there are c3plot methods for various 'R' objects. Use methods(c3plot) and the documentation for these.
Plots created with this are interactive htmlwidgets that can be used in the RStudio Viewer or embedded into 'R Markdown' documents, 'Shiny' web applications, etc.
For the default method, the argument y with the y coordinates of points is required. For some methods, such as c3plot.density and c3plot.function, y is not required because those methods can compute or extract y coordinates from the x object
Examples
data(mtcars)
c3plot(mtcars$disp, mtcars$hp, main = "Displacement vs. HP in mtcars")
c3plot(qnorm)