14
14
# ' @param color Either a variable name or a vector to use for color mapping.
15
15
# ' @param colors Either a colorbrewer2.org palette name (e.g. "YlOrRd" or "Blues"),
16
16
# ' or a vector of colors to interpolate in hexadecimal "#RRGGBB" format,
17
- # ' or a color interpolation function like \link{grDevices:: colorRamp}.
17
+ # ' or a color interpolation function like \code{ colorRamp() }.
18
18
# ' @param symbol Either a variable name or a (discrete) vector to use for symbol encoding.
19
19
# ' @param symbols A character vector of symbol types. Possible values:
20
20
# ' 'dot', 'cross', 'diamond', 'square', 'triangle-down', 'triangle-left', 'triangle-right', 'triangle-up'
21
21
# ' @param size A variable name or numeric vector to encode the size of markers.
22
- # ' @param inherit should future traces inherit properties from this initial trace?
22
+ # ' @param filename character string describing the name of the plot in your plotly account.
23
+ # ' Use / to specify directories. If a directory path does not exist it will be created.
24
+ # ' If this argument is not specified and the title of the plot exists,
25
+ # ' that will be used for the filename.
26
+ # ' @param fileopt character string describing whether to create a "new" plotly, "overwrite" an existing plotly,
27
+ # ' "append" data to existing plotly, or "extend" it.
28
+ # ' @param world_readable logical. If \code{TRUE}, the graph is viewable
29
+ # ' by anyone who has the link and in the owner's plotly account.
30
+ # ' If \code{FALSE}, graph is only viewable in the owner's plotly account.
31
+ # ' @param inherit logical. Should future traces inherit properties from this initial trace?
23
32
# ' @param evaluate logical. Evaluate arguments when this function is called?
24
33
# ' @seealso \code{\link{layout}()}, \code{\link{add_trace}()}, \code{\link{style}()}
25
34
# ' @references \url{https://plot.ly/r/reference/}
45
54
# '
46
55
plot_ly <- function (data = data.frame (), ... , type = " scatter" ,
47
56
group , color , colors , symbol , symbols , size ,
57
+ filename , fileopt , world_readable = TRUE ,
48
58
inherit = TRUE , evaluate = FALSE ) {
49
59
# "native" plotly arguments
50
60
argz <- substitute(list (... ))
@@ -69,6 +79,11 @@ plot_ly <- function(data = data.frame(), ..., type = "scatter",
69
79
layout = NULL ,
70
80
url = NULL
71
81
)
82
+ # tack on special keyword arguments
83
+ if (! missing(filename )) p $ filename <- filename
84
+ if (! missing(fileopt )) p $ fileopt <- fileopt
85
+ p $ world_readable <- world_readable
86
+
72
87
if (evaluate ) p <- plotly_build(p )
73
88
hash_plot(data , p )
74
89
}
@@ -83,7 +98,7 @@ plot_ly <- function(data = data.frame(), ..., type = "scatter",
83
98
# ' @param color Either a variable name or a vector to use for color mapping.
84
99
# ' @param colors Either a colorbrewer2.org palette name (e.g. "YlOrRd" or "Blues"),
85
100
# ' or a vector of colors to interpolate in hexadecimal "#RRGGBB" format,
86
- # ' or a color interpolation function like \link{grDevices:: colorRamp}.
101
+ # ' or a color interpolation function like \code{ colorRamp}.
87
102
# ' @param symbol Either a variable name or a (discrete) vector to use for symbol encoding.
88
103
# ' @param symbols A character vector of symbol types. Possible values:
89
104
# ' 'dot', 'cross', 'diamond', 'square', 'triangle-down', 'triangle-left', 'triangle-right', 'triangle-up'
0 commit comments