Skip to content

Commit b43e080

Browse files
committed
better name for the function format_wells
1 parent c528efb commit b43e080

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

R/wells.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
#' Standardize a vector with well names.
1+
#' Normalize a vector with well names.
22
#'
33
#' @param v A vector with potentially sloppy well names
44
#' @param format A single element character or numeric vector with the format of the plate
55
#' @return A vector with standardized well names
66
#' @export
77
#' @examples
8-
#' format_wells(c("a01", "A 2", "0", " A 4 ", "A05", "H012"), 96)
8+
#' normalize_wells(c("a01", "A 2", "0", " A 4 ", "A05", "H012"), 96)
99
#'
1010
#'
11-
format_wells <- function(v, format) {
11+
normalize_wells <- function(v, format) {
1212
v <- as.character(v) |>
1313
stringr::str_remove_all(" ") |>
1414
stringr::str_to_upper() |>

tests/testthat/test-wells.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
test_that("function format_wells", {
1+
test_that("function normalize_wells", {
22
wells1 <- c("A1", "B2", "c3", "0", "0")
33
expect1 <- c("A1", "B2", "C3", NA, NA)
4-
expect_equal(format_wells(wells1, 96), expect1)
4+
expect_equal(normalize_wells(wells1, 96), expect1)
55
wells2 <- c(0, 0)
66
expect2 <- as.character(c(NA, NA))
7-
expect_equal(format_wells(wells2, 96), expect2)
7+
expect_equal(normalize_wells(wells2, 96), expect2)
88
wells3 <- c("A01", " B02", "c03 ", " d0100", "E 50")
99
expect3 <- c("A1", "B2", "C3", NA, NA)
10-
expect_equal(format_wells(wells3, 96), expect3)
10+
expect_equal(normalize_wells(wells3, 96), expect3)
1111
})
1212

1313
test_that("Function check_wells works", {

0 commit comments

Comments
 (0)