A 'ggplot2' Extension for Visualizing Density, Distribution, Hazard, or Survival Functions using the 'logspline' Package
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
3.2 KiB

1 year ago
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/stat-logspline.R
  3. \name{stat_logspline}
  4. \alias{stat_logspline}
  5. \title{Computes and draws...}
  6. \usage{
  7. stat_logspline(mapping = NULL, data = NULL, geom = "area",
  8. position = "identity", na.rm = FALSE, show.legend = NA,
  9. inherit.aes = TRUE, n = 100, max_knots = 0, n_knots = 0,
  10. min_d = -1, error_action = 2, ...)
  11. }
  12. \arguments{
  13. \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
  14. \code{\link[=aes_]{aes_()}}. If specified and \code{inherit.aes = TRUE} (the
  15. default), it is combined with the default mapping at the top level of the
  16. plot. You must supply \code{mapping} if there is no plot mapping.}
  17. \item{data}{The data to be displayed in this layer. There are three
  18. options:
  19. If \code{NULL}, the default, the data is inherited from the plot
  20. data as specified in the call to \code{\link[=ggplot]{ggplot()}}.
  21. A \code{data.frame}, or other object, will override the plot
  22. data. All objects will be fortified to produce a data frame. See
  23. \code{\link[=fortify]{fortify()}} for which variables will be created.
  24. A \code{function} will be called with a single argument,
  25. the plot data. The return value must be a \code{data.frame}, and
  26. will be used as the layer data. A \code{function} can be created
  27. from a \code{formula} (e.g. \code{~ head(.x, 10)}).}
  28. \item{geom}{Use to override the default connection between
  29. \code{geom_density} and \code{stat_density}.}
  30. \item{position}{Position adjustment, either as a string, or the result of
  31. a call to a position adjustment function.}
  32. \item{na.rm}{If \code{FALSE}, the default, missing values are removed with
  33. a warning. If \code{TRUE}, missing values are silently removed.}
  34. \item{show.legend}{logical. Should this layer be included in the legends?
  35. \code{NA}, the default, includes if any aesthetics are mapped.
  36. \code{FALSE} never includes, and \code{TRUE} always includes.
  37. It can also be a named logical vector to finely select the aesthetics to
  38. display.}
  39. \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics,
  40. rather than combining with them. This is most useful for helper functions
  41. that define both data and aesthetics and shouldn't inherit behaviour from
  42. the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
  43. \item{n}{numbe of points for the density estimation (larger == smoother)}
  44. \item{max_knots}{the maximum number of knots. The routine stops adding knots when
  45. this number of knots is reached. The method has an automatic rule for selecting
  46. maxknots if this parameter is not specified.}
  47. \item{n_knots}{forces the method to start with nknots knots. The method has an automatic
  48. rule for selecting nknots if this parameter is not specified.}
  49. \item{min_d}{minimum distance, in order statistics, between knots.}
  50. \item{error_action}{see \code{error.action} in \code{\link[logspline:plot.logspline]{logspline::plot.logspline()}}}
  51. \item{...}{Other arguments passed on to \code{\link[=layer]{layer()}}. These are
  52. often aesthetics, used to set an aesthetic to a fixed value, like
  53. \code{colour = "red"} or \code{size = 3}. They may also be parameters
  54. to the paired geom/stat.}
  55. }
  56. \description{
  57. Computes and draws...
  58. }
  59. \examples{
  60. library(ggplot2)
  61. set.seed(1)
  62. data.frame(
  63. val = rnorm(100)
  64. ) -> xdf
  65. ggplot(xdf) + stat_logspline(aes(val))
  66. }