Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

R Programming/Grammar of graphics

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Hadley Wickham has developed the ggplot2, a graphical library designed according to the principles of the Grammar of Graphics. Plotting a function We use qplot() with the option stat=function : # Plot the quadratic function square <- function(x){ x^2 } mode(square) qplot(c(0, 2), stat = "function", fun = square, geom = "line") Here is another example with the sinus function : # plot the sinus function qplot(c(-10, 10), stat = "function", fun = sin, geom = "line") Bibliography Leland Wilkinson, The Grammar of Graphics (Statistics and Computing), Springer, 2005 Hadley Wickham, ggplot2: Elegant Graphics for Data Analysis, Use R!, Springer, 2009 Resources Documentation page for ggplot2