Skip to content

Commit

Permalink
make pcr_plate_view more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiAragaki committed Aug 30, 2024
1 parent 24c967e commit be84fe6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Imports:
dplyr (>= 1.1.0),
forcats,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

S3method(pcr_control,data.frame)
S3method(pcr_control,pcr)
S3method(pcr_plate_view,data.frame)
S3method(pcr_plate_view,pcr)
S3method(pcr_plot,data.frame)
S3method(pcr_plot,pcr)
S3method(pcr_rq,data.frame)
Expand Down
13 changes: 11 additions & 2 deletions R/pcr_plate_view.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@
#'
#' @examples
#' system.file("extdata", "untidy-pcr-example.xls", package = "amplify") |>
#' pcr_tidy() |>
#' read_pcr() |>
#' pcr_plate_view()

pcr_plate_view <- function(pcr, fill = target_name) {
UseMethod("pcr_plate_view")
}

#' @export
pcr_plate_view.pcr <- function(pcr, fill = target_name) {
pcr <- tidy_if_not(pcr)
gplate::gp_plot(pcr$data, {{fill}})
}

#' @export
pcr_plate_view.data.frame <- function(pcr, fill = target_name) {
gplate::gp_plot(pcr, {{fill}})
}

0 comments on commit be84fe6

Please sign in to comment.