1- # ' @name plotly
2- # ' @rdname plotly
3- # ' @inherit plotly ::plot_ly
1+ # ' @name plot_ly
2+ # ' @rdname plot_ly
3+ # ' @inherit ttservice ::plot_ly
44# ' @return `plotly`
55# '
66# ' @examples
7- # ' data(pasilla)
8- # ' plot_ly(pasilla)
7+ # ' data(se)
8+ # ' se |>
9+ # ' plot_ly(x = ~counts)
910# '
10- # ' @importFrom plotly plot_ly
11- # ' @export
12- plot_ly <- function (data = data.frame (), ... , type = NULL , name = NULL ,
13- color = NULL , colors = NULL , alpha = NULL ,
14- stroke = NULL , strokes = NULL , alpha_stroke = 1 ,
15- size = NULL , sizes = c(10 , 100 ),
16- span = NULL , spans = c(1 , 20 ),
17- symbol = NULL , symbols = NULL ,
18- linetype = NULL , linetypes = NULL ,
19- split = NULL , frame = NULL ,
20- width = NULL , height = NULL , source = " A" ) {
21- UseMethod(" plot_ly" )
22- }
23-
24- # ' @rdname plotly
11+ # ' @importFrom ttservice plot_ly
2512# ' @export
2613plot_ly.tbl_df <- function (data = data.frame (), ... , type = NULL , name = NULL ,
2714 color = NULL , colors = NULL , alpha = NULL ,
@@ -32,10 +19,10 @@ plot_ly.tbl_df <- function(data=data.frame(), ..., type=NULL, name=NULL,
3219 linetype = NULL , linetypes = NULL ,
3320 split = NULL , frame = NULL ,
3421 width = NULL , height = NULL , source = " A" ) {
35- data % > %
22+ data | >
3623
3724 # This is a trick to not loop the call
38- drop_class(" tbl_df" ) % > %
25+ drop_class(" tbl_df" ) | >
3926 plotly :: plot_ly(... ,
4027 type = type , name = name ,
4128 color = color , colors = colors , alpha = alpha ,
@@ -49,7 +36,17 @@ plot_ly.tbl_df <- function(data=data.frame(), ..., type=NULL, name=NULL,
4936 )
5037}
5138
52- # ' @rdname plotly
39+ # ' @name plot_ly
40+ # ' @rdname plot_ly
41+ # ' @inherit ttservice::plot_ly
42+ # ' @return `plotly`
43+ # '
44+ # ' @examples
45+ # ' data(se)
46+ # ' se |>
47+ # ' plot_ly(x = ~counts)
48+ # '
49+ # ' @importFrom ttservice plot_ly
5350# ' @export
5451plot_ly.SummarizedExperiment <- function (data = data.frame (),
5552 ... , type = NULL , name = NULL ,
@@ -61,10 +58,10 @@ plot_ly.SummarizedExperiment <- function(data=data.frame(),
6158 linetype = NULL , linetypes = NULL ,
6259 split = NULL , frame = NULL ,
6360 width = NULL , height = NULL , source = " A" ) {
64- data % > %
61+ data | >
6562
6663 # This is a trick to not loop the call
67- as_tibble() % > %
64+ as_tibble() | >
6865 plotly :: plot_ly(... ,
6966 type = type , name = name ,
7067 color = color , colors = colors , alpha = alpha ,
0 commit comments