Skip to content

Commit e83e413

Browse files
committed
convert docs to markdown; fixes plotly#1053
1 parent c7b9613 commit e83e413

69 files changed

Lines changed: 314 additions & 313 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ Remotes:
7070
ramnathv/htmlwidgets
7171
LazyData: true
7272
RoxygenNote: 6.0.1
73+
Roxygen: list(markdown = TRUE)

R/add.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ add_data <- function(p, data = NULL) {
2323
#'
2424
#' @inheritParams plot_ly
2525
#' @param p a plotly object
26-
#' @param inherit inherit attributes from \code{\link{plot_ly}()}?
26+
#' @param inherit inherit attributes from [plot_ly()]?
2727
#' @param z a numeric matrix
2828
#' @param x the x variable.
2929
#' @param y the y variable.
@@ -32,7 +32,7 @@ add_data <- function(p, data = NULL) {
3232
#' @param ymax a variable used to define the upper boundary of a polygon.
3333
#' @param xend "final" x position (in this context, x represents "start")
3434
#' @param yend "final" y position (in this context, y represents "start")
35-
#' @seealso \code{\link{plot_ly}()}
35+
#' @seealso [plot_ly()]
3636
#' @references \url{https://plot.ly/r/reference/}
3737
#' @author Carson Sievert
3838
#' @export
@@ -268,7 +268,7 @@ add_area <- function(p, r = NULL, t = NULL, ...,
268268
#' @inheritParams add_trace
269269
#' @rdname add_trace
270270
#' @param values the value to associated with each slice of the pie.
271-
#' @param labels the labels (categories) corresponding to \code{values}.
271+
#' @param labels the labels (categories) corresponding to `values`.
272272
#' @export
273273
#' @examples
274274
#' ds <- data.frame(
@@ -564,7 +564,7 @@ special_attrs <- function(trace) {
564564
#' @param p a plotly object.
565565
#' @param fun a function. Should take a plotly object as input and return a
566566
#' modified plotly object.
567-
#' @param ... arguments passed to \code{fun}.
567+
#' @param ... arguments passed to `fun`.
568568
#' @export
569569
#' @examples
570570
#'
@@ -608,7 +608,7 @@ add_fun <- function(p, fun, ...) {
608608
#' @param ... these arguments are documented at
609609
#' \url{https://github.com/plotly/plotly.js/blob/master/src/components/annotations/attributes.js}
610610
#' @param data a data frame.
611-
#' @param inherit inherit attributes from \code{\link{plot_ly}()}?
611+
#' @param inherit inherit attributes from [plot_ly()]?
612612
#' @author Carson Sievert
613613
#' @export
614614
#' @examples

R/animate.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#' Animation configuration options
22
#'
3-
#' Animations can be created by either using the \code{frame} argument in
4-
#' \code{\link{plot_ly}()} or the (unofficial) \code{frame} ggplot2 aesthetic in
5-
#' \code{\link{ggplotly}()}. By default, animations populate a play button
3+
#' Animations can be created by either using the `frame` argument in
4+
#' [plot_ly()] or the (unofficial) `frame` ggplot2 aesthetic in
5+
#' [ggplotly()]. By default, animations populate a play button
66
#' and slider component for controlling the state of the animation
77
#' (to pause an animation, click on a relevant location on the slider bar).
88
#' Both the play button and slider component transition between frames according
9-
#' rules specified by \code{\link{animation_opts}()}.
9+
#' rules specified by [animation_opts()].
1010
#'
1111
#' @param p a plotly object.
1212
#' @param frame The amount of time between frames (in milliseconds).
13-
#' Note that this amount should include the \code{transition}.
13+
#' Note that this amount should include the `transition`.
1414
#' @param transition The duration of the smooth transition between
1515
#' frames (in milliseconds).
1616
#' @param easing The type of transition easing. See the list of options here
@@ -124,11 +124,11 @@ animation_opts_defaults <- function() {
124124

125125
#' @inheritParams animation_opts
126126
#' @param hide remove the animation slider?
127-
#' @param ... for \code{animation_slider}, attributes are passed to a special
127+
#' @param ... for `animation_slider`, attributes are passed to a special
128128
#' layout.sliders object tied to the animation frames.
129129
#' The definition of these attributes may be found here
130130
#' \url{https://github.com/plotly/plotly.js/blob/master/src/components/sliders/attributes.js}
131-
#' For \code{animation_button}, arguments are passed to a special
131+
#' For `animation_button`, arguments are passed to a special
132132
#' layout.updatemenus button object tied to the animation
133133
#' \url{https://github.com/plotly/plotly.js/blob/master/src/components/updatemenus/attributes.js}
134134
#' @export

R/api_exports.R

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#' Tools for working with plotly's REST API (v2)
22
#'
33
#' Convenience functions for working with version 2 of plotly's REST API.
4-
#' Upload R objects to a plotly account via \code{api_create()} and download
5-
#' plotly objects via \code{api_download_plot()}/\code{api_download_grid()}.
6-
#' For anything else, use \code{api()}.
4+
#' Upload R objects to a plotly account via `api_create()` and download
5+
#' plotly objects via `api_download_plot()`/`api_download_grid()`.
6+
#' For anything else, use `api()`.
77
#'
88
#' @param id a filename id.
99
#' @param username a plotly username.
1010
#'
1111
#' @param x An R object to hosted on plotly's web platform.
1212
#' Can be a plotly/ggplot2 object or a \link{data.frame}.
13-
#' @param filename character vector naming file(s). If \code{x} is a plot,
13+
#' @param filename character vector naming file(s). If `x` is a plot,
1414
#' can be a vector of length 2 naming both the plot AND the underlying grid.
1515
#' @param fileopt character string describing whether to "overwrite" existing
1616
#' files or ensure "new" file(s) are always created.
@@ -29,23 +29,23 @@
2929
#' You do not need to be logged in to view this plot.
3030
#'
3131
#' @param endpoint the endpoint (i.e., location) for the request.
32-
#' To see a list of all available endpoints, call \code{api()}.
32+
#' To see a list of all available endpoints, call `api()`.
3333
#' Any relevant query parameters should be included here (see examples).
34-
#' @param verb name of the HTTP verb to use (as in, \code{\link[httr]{VERB}()}).
35-
#' @param body body of the HTTP request(as in, \code{\link[httr]{VERB}()}).
34+
#' @param verb name of the HTTP verb to use (as in, [httr::VERB()]).
35+
#' @param body body of the HTTP request(as in, [httr::VERB()]).
3636
#' If this value is not already converted to JSON
37-
#' (via \code{\link[jsonlite]{toJSON}()}), it uses the internal \code{to_JSON()}
37+
#' (via [jsonlite::toJSON()]), it uses the internal `to_JSON()`
3838
#' to ensure values are "automatically unboxed" (i.e., vec.
3939
#'
40-
#' @param ... For \code{api()}, these arguments are passed onto
41-
#' \code{\link[httr]{VERB}()}. For \code{api_create()}, these arguments are
40+
#' @param ... For `api()`, these arguments are passed onto
41+
#' [httr::VERB()]. For `api_create()`, these arguments are
4242
#' included in the body of the HTTP request.
4343
#'
4444
#' @export
4545
#' @rdname api
4646
#' @author Carson Sievert
4747
#' @references \url{https://api.plot.ly/v2}
48-
#' @seealso \code{\link{signup}()}
48+
#' @seealso [signup()]
4949
#' @examples
5050
#'
5151
#' \dontrun{

R/data.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
#'
33
#' Description TBD.
44
#'
5-
#' @format A data frame with three variables: \code{r}, \code{t},
6-
#' \code{nms}.
5+
#' @format A data frame with three variables: `r`, `t`,
6+
#' `nms`.
77
"wind"
88

99
#' Mic data
1010
#'
1111
#' Description TBD.
1212
#'
13-
#' @format A data frame with three variables: \code{r}, \code{t},
14-
#' \code{nms}.
13+
#' @format A data frame with three variables: `r`, `t`,
14+
#' `nms`.
1515
"mic"
1616

1717
#' Hobbs data
1818
#'
1919
#' Description TBD.
2020
#'
21-
#' @format A data frame with three variables: \code{r}, \code{t},
22-
#' \code{nms}.
21+
#' @format A data frame with three variables: `r`, `t`,
22+
#' `nms`.
2323
"hobbs"

R/deprecated.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' Create/Modify plotly graphs
22
#'
3-
#' Deprecated: see \code{\link{api_create}()}.
3+
#' Deprecated: see [api_create()].
44
#'
55
#' @param x either a ggplot object, a plotly object, or a list.
66
#' @param filename character string describing the name of the plot in your
@@ -25,7 +25,7 @@
2525
#' You do not need to be logged in to view this plot.
2626
#' @param ... not used
2727
#' @export
28-
#' @seealso \code{\link{plot_ly}()}, \code{\link{signup}()}
28+
#' @seealso [plot_ly()], [signup()]
2929
plotly_POST <- function(x = last_plot(), filename = NULL, fileopt = "overwrite",
3030
sharing = c("public", "private", "secret"), ...) {
3131
.Deprecated("api_create")
@@ -34,7 +34,7 @@ plotly_POST <- function(x = last_plot(), filename = NULL, fileopt = "overwrite",
3434

3535
#' Request a figure object
3636
#'
37-
#' Deprecated: see \code{\link{api_download_plot}()}.
37+
#' Deprecated: see [api_download_plot()].
3838
#'
3939
#' @param username corresponding username for the figure.
4040
#' @param id of the Plotly figure.
@@ -57,7 +57,7 @@ get_figure <- function(username, id) {
5757
#' @param username plotly username
5858
#' @param key plotly API key
5959
#' @export
60-
#' @seealso \code{\link{ggplotly}()}, \code{\link{plot_ly}()}, \code{\link{signup}()}
60+
#' @seealso [ggplotly()], [plot_ly()], [signup()]
6161
plotly <- function(username, key) {
6262

6363
if (!missing(username)) {
@@ -88,7 +88,7 @@ plotly <- function(username, key) {
8888
#' @param width A valid CSS unit. (like "100\%", "600px", "auto") or a number,
8989
#' which will be coerced to a string and have "px" appended.
9090
#' @param out_dir a directory to place the visualization.
91-
#' If \code{NULL}, a temporary directory is used when the offline object is printed.
91+
#' If `NULL`, a temporary directory is used when the offline object is printed.
9292
#' @param open_browser open the visualization after creating it?
9393
#' @author Carson Sievert
9494
#' @return a plotly object of class "offline"
@@ -107,7 +107,7 @@ offline <- function(p, height, width, out_dir, open_browser) {
107107
#' so there is no need to convert them.
108108
#'
109109
#' @param x a plotly object.
110-
#' @param ... other options passed onto \code{htmlwidgets::createWidget}
110+
#' @param ... other options passed onto `htmlwidgets::createWidget`
111111
#' @export
112112

113113
as.widget <- function(x, ...) {

R/dev.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#' sent to plotly.js.
55
#'
66
#' @param p a plotly or ggplot object.
7-
#' @param jsonedit use \code{listviewer::jsonedit} to view the JSON?
8-
#' @param ... other options passed onto \code{listviewer::jsonedit}
7+
#' @param jsonedit use `listviewer::jsonedit` to view the JSON?
8+
#' @param ... other options passed onto `listviewer::jsonedit`
99
#' @export
1010
#' @examples
1111
#'
@@ -27,8 +27,8 @@ plotly_json <- function(p = last_plot(), jsonedit = interactive(), ...) {
2727
#' The schema contains valid attributes names, their value type,
2828
#' default values (if any), and min/max values (if applicable).
2929
#'
30-
#' @param jsonedit use \code{listviewer::jsonedit} to view the JSON?
31-
#' @param ... other options passed onto \code{listviewer::jsonedit}
30+
#' @param jsonedit use `listviewer::jsonedit` to view the JSON?
31+
#' @param ... other options passed onto `listviewer::jsonedit`
3232
#' @export
3333
#' @examples
3434
#' s <- schema()

R/embed.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#' Embed a plot as an iframe into a Jupyter Notebook
22
#' @param x a plotly object
3-
#' @param width attribute of the iframe. If \code{NULL}, the width in
4-
#' \code{plot_ly} is used. If that is also \code{NULL}, '100\%' is the default.
5-
#' @param height attribute of the iframe. If \code{NULL}, the height in
6-
#' \code{plot_ly} is used. If that is also \code{NULL}, '400px' is the default.
3+
#' @param width attribute of the iframe. If `NULL`, the width in
4+
#' `plot_ly` is used. If that is also `NULL`, '100\%' is the default.
5+
#' @param height attribute of the iframe. If `NULL`, the height in
6+
#' `plot_ly` is used. If that is also `NULL`, '400px' is the default.
77
#' @param file deprecated.
88
#' @author Carson Sievert
99
#' @export

R/export.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#' Export a plotly graph to a static file
22
#'
3-
#' @details For SVG plots, a screenshot is taken via \code{webshot::webshot()}.
4-
#' Since \code{phantomjs} (and hence \code{webshot}) does not support WebGL,
3+
#' @details For SVG plots, a screenshot is taken via `webshot::webshot()`.
4+
#' Since `phantomjs` (and hence `webshot`) does not support WebGL,
55
#' the RSelenium package is used for exporting WebGL plots.
66
#'
77
#' @param p a plotly or ggplot object.
88
#' @param file a filename. The file type is inferred from the file extension.
99
#' Valid extensions include 'jpeg' | 'png' | 'webp' | 'svg' | 'pdf'
10-
#' @param selenium used only when \code{p} is a WebGL plot or the output
10+
#' @param selenium used only when `p` is a WebGL plot or the output
1111
#' format is 'webp' or 'svg'. Should be an object of class "rsClientServer"
12-
#' returned by \code{RSelenium::rsDriver} (see examples).
13-
#' @param ... if \code{p} is non-WebGL and the output file format is
14-
#' jpeg/png/pdf arguments are passed along to \code{webshot::webshot()}.
12+
#' returned by `RSelenium::rsDriver` (see examples).
13+
#' @param ... if `p` is non-WebGL and the output file format is
14+
#' jpeg/png/pdf arguments are passed along to `webshot::webshot()`.
1515
#' Otherwise, they are ignored.
1616
#' @export
1717
#' @author Carson Sievert

R/ggplotly.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#' Convert ggplot2 to plotly
22
#'
3-
#' This function converts a \code{\link[ggplot2]{ggplot}()} object to a
3+
#' This function converts a [ggplot2::ggplot()] object to a
44
#' plotly object.
55
#'
66
#' @details Conversion of relative sizes depends on the size of the current
77
#' graphics device (if no device is open, width/height of a new (off-screen)
8-
#' device defaults to 640/480). In other words, \code{height} and
9-
#' \code{width} must be specified at runtime to ensure sizing is correct.
8+
#' device defaults to 640/480). In other words, `height` and
9+
#' `width` must be specified at runtime to ensure sizing is correct.
1010
#'
1111
#' @param p a ggplot object.
1212
#' @param width Width of the plot in pixels (optional, defaults to automatic sizing).
@@ -15,7 +15,7 @@
1515
#' in the tooltip. The default, "all", means show all the aesthetic mappings
1616
#' (including the unofficial "text" aesthetic). The order of variables here will
1717
#' also control the order they appear. For example, use
18-
#' \code{tooltip = c("y", "x", "colour")} if you want y first, x second, and
18+
#' `tooltip = c("y", "x", "colour")` if you want y first, x second, and
1919
#' colour last.
2020
#' @param dynamicTicks should plotly.js dynamically generate axis tick labels?
2121
#' Dynamic ticks are useful for updating ticks in response to zoom/pan
@@ -24,13 +24,13 @@
2424
#' @param layerData data from which layer should be returned?
2525
#' @param originalData should the "original" or "scaled" data be returned?
2626
#' @param source a character string of length 1. Match the value of this string
27-
#' with the source argument in \code{\link{event_data}()} to retrieve the
27+
#' with the source argument in [event_data()] to retrieve the
2828
#' event data corresponding to a specific plot (shiny apps can have multiple plots).
2929
#' @param ... arguments passed onto methods.
3030
#' @export
3131
#' @author Carson Sievert
3232
#' @references \url{https://plot.ly/ggplot2}
33-
#' @seealso \code{\link{plot_ly}()}
33+
#' @seealso [plot_ly()]
3434
#' @examples \dontrun{
3535
#' # simple example
3636
#' ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
@@ -149,14 +149,14 @@ ggplotly.ggplot <- function(p = ggplot2::last_plot(), width = NULL,
149149
#' @param tooltip a character vector specifying which aesthetic tooltips to show in the
150150
#' tooltip. The default, "all", means show all the aesthetic tooltips
151151
#' (including the unofficial "text" aesthetic).
152-
#' @param dynamicTicks accepts the following values: \code{FALSE}, \code{TRUE}, \code{"x"}, or \code{"y"}.
152+
#' @param dynamicTicks accepts the following values: `FALSE`, `TRUE`, `"x"`, or `"y"`.
153153
#' Dynamic ticks are useful for updating ticks in response to zoom/pan/filter
154154
#' interactions; however, there is no guarantee they reproduce axis tick text
155155
#' as they would appear in the static ggplot2 image.
156156
#' @param layerData data from which layer should be returned?
157157
#' @param originalData should the "original" or "scaled" data be returned?
158158
#' @param source a character string of length 1. Match the value of this string
159-
#' with the source argument in \code{\link{event_data}()} to retrieve the
159+
#' with the source argument in [event_data()] to retrieve the
160160
#' event data corresponding to a specific plot (shiny apps can have multiple plots).
161161
#' @param ... currently not used
162162
#' @return a 'built' plotly object (list with names "data" and "layout").

0 commit comments

Comments
 (0)