nanodrop: Make a nanodrop object

Description Usage Arguments Details Value Examples

View source: R/nanodrop.R

Description

Make a nanodrop object

Usage

1
2
3
4
5
6
nanodrop(
  data,
  date = NULL,
  nucleotide = c("RNA", "DNA", "dsDNA", "dsRNA"),
  is_tidy = FALSE
)

Arguments

data

a data.frame - or something coercible to one - containing nanodrop data. See details for requirements.

date

an optional character vector or something coercible to a Date object with lubridate::as_date

nucleotide

a character vector to specifying the analyte in the nanodrop experiment. Must match one of the following: RNA, DNA, dsDNA, or dsRNA.

is_tidy

logical. Is the supplied data tidy?

Details

Making a nanodrop object 'by hand' (that is, not using read_nanodrop) is not recommended, since it is challenging to ensure a given data.frame is truly a valid nanodrop file. To increase reliability, flexibility is reduced. As such, the supplied data.frame must at least have the following columns if is_tidy = TRUE:

If is_tidy = FALSE, at least the following columns must be provided:

Note: technically, the given column names will be stripped of all non-alphanumerics and forced tolower, then compared against the following:

In both cases, other columns allowed are those that appear in Example A and Example B below.

If there are additional columns provided, they will be silently dropped.

Value

a nanodrop object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Example A: colnames allowed when is_tidy = FALSE
a <- system.file("extdata", "nanodrop.csv", package = "ragaki") |>
read_nanodrop()

colnames(a$data)

# Technically, these are the names that are checked for after the given names
# have alphanumerics removed and are converted to lowercase:

colnames(a$data) |> stringr::str_remove_all("[^[:alnum:]]") |> tolower()


# Example B: colnames allowed when is_tidy = TRUE
b <- a |> tidy_lab()

colnames(b$data)

KaiAragaki/ragaki documentation built on Dec. 25, 2021, 2:24 a.m.