read_nanodrop: Read in a NanoDrop file

Description Usage Arguments Details Value Examples

View source: R/read_nanodrop.R

Description

Read in a NanoDrop file

Usage

1
read_nanodrop(path, nucleotide = NULL, date = NULL, date_order = NULL)

Arguments

path

path to a NanoDrop .csv

nucleotide

An optional character vector describing the analyte detected. If NULL (the default), it will automatically try to extract one from the file path. Other valid values include RNA, DNA, dsDNA, and dsRNA (or NULL).

date

An optional character vector coercible to a date object. If NULL (the default), it will automatically try to extract one from the file path. See details for detection methods.

date_order

An optional character vector to enforce an order of date to be read (if date is unspecified). Can be "ymd", "mdy", or "dmy"

Details

This function calls read.delim with the encoding UTF-16LE (what nanodrop files are encoded in). It's less mysterious than reading in an apparent .csv with read.delim, and it keeps you from having to remember the encoding (which R often fails to auto-detect). When possible, it attempts to extract the nucleotide type from the path provided.

if date is NULL, the function will attempt to extract a date from the file name (not the whole file path). It will look for ymd, mdy, and dmy (in order). If it detects the first format, it will not look for the second, etc. Note how a reading taken from April 4th but written as 4_3_2021 will be misinterpreted. The format can be enforced by specifying the argument date_order

Value

a nanodrop object

Examples

1
2
system.file("extdata", "nanodrop.csv", package = "ragaki") |>
  read_nanodrop()

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