dates_to_posix: Convert data/time to POSIXct

Description Usage Arguments Value Examples

View source: R/date_conversion.R

Description

convert date/time column of sample_annotation to POSIX format required to keep number-like behavior

Usage

1
2
3
4
5
6
7
dates_to_posix(
  sample_annotation,
  time_column = c("RunDate", "RunTime"),
  new_time_column = "DateTime",
  dateTimeFormat = c("%b_%d", "%H:%M:%S"),
  tz = "GMT"
)

Arguments

sample_annotation

data frame with:

  1. sample_id_col (this can be repeated as row names)

  2. biological covariates

  3. technical covariates (batches etc)

. See help("example_sample_annotation")

time_column

name of the column(s) where run date & time are specified. These will be used to determine the run order

new_time_column

name of the new column to which date&time will be converted to

dateTimeFormat

POSIX format of the date and time. See as.POSIXct from base R for details

tz

for time zone

Value

sample annotation file with a new column new_time_column with POSIX-formatted date

Examples

1
2
3
4
date_to_posix <- dates_to_posix(example_sample_annotation, 
time_column = c('RunDate','RunTime'),
new_time_column = 'DateTime_new', 
dateTimeFormat = c("%b_%d", "%H:%M:%S"))

proBatch documentation built on Nov. 8, 2020, 4:55 p.m.