BSkystrptime: Convert character to date

BSkystrptimeR Documentation

Convert character to date

Description

Converts a character to a date (POSIXct class). You need to specify the format of the date stored in a character string. The function above internally calls strptime in the base package. We have extended strftime to support multiple variables.

Usage

BSkystrptime(
  varNames = "",
  dateFormat = "",
  timezone = "",
  prefixOrSuffix = "suffix",
  prefixOrSuffixValue = "",
  data = ""
)

Arguments

varNames

The variable names of class character that need to be converted to date (POSIXct class)

dateFormat

A character string. The default for the format methods is "%Y-%m-%d %H:%M:%S" if any element has a time component which is not midnight, and "%Y-%m-%d" otherwise. If options("digits.secs") is set, up to the specified number of digits will be printed for seconds

timezone

A character string specifying the time zone to be used for the conversion. System-specific (see as.POSIXlt), but "" is the current time zone, and "GMT" is UTC. Invalid values are most commonly treated as UTC, on some platforms with a warning.

prefixOrSuffix

Specific a prefix or suffix for the converted variables of class POSIXct . Takes either c("prefix") or c("suffix"). New variables that are created with this prefix/suffix to the original variable name.

prefixOrSuffixValue

A character vector that specifies the name of the prefix or suffix to be used.

data

The dataset name as a character string.

Value

a date (POSIXct class)


BlueSkyStatistics/BlueSky documentation built on April 14, 2025, 7:39 a.m.