Skip to content

Commit

Permalink
liming's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit committed Apr 19, 2024
1 parent 7aea77f commit c504254
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,19 @@ as.gg_list <- function(obj) { # nolint
#' @export
as.gg_list.list <- function(obj) {
assert_list(obj, types = "ggplot")
do_call(gg_list, obj)
structure(
obj,
class = c("gg_list", "list")
)
}

#' @rdname rl_list
#' @export
as.gg_list.ggplot <- function(obj) {
do_call(gg_list, list(obj))
structure(
list(obj),
class = c("gg_list", "list")
)
}

# rl_list ----
Expand Down Expand Up @@ -197,13 +203,19 @@ as.rl_list <- function(obj) { # nolint
#' @export
as.rl_list.list <- function(obj) {
assert_list(obj, types = "listing_df")
do_call(rl_list, obj)
structure(
obj,
class = c("rl_list", "list")
)
}

#' @rdname rl_list
#' @export
as.rl_list.listing_df <- function(obj) {
do_call(rl_list, list(obj))
structure(
list(obj),
class = c("rl_list", "list")
)
}

# lvl ----
Expand Down

0 comments on commit c504254

Please sign in to comment.