Dat: Date Vectors

View source: R/Dat.R

DatR Documentation

Date Vectors

Description

Creates objects of type "hd_Dat". hd_Dat objects contain three main attributes: categories, n_categories and stats. With categories you can check wich values are valid for the variable. With n_categories you can check how many of valid values are valid for the variable. With the last attribute, stats, you can check different basic operations to describe the varaible (n_unique, n_na, pct_na and summary).

Usage

Dat(x = character(), format = NULL, skip_stats = FALSE)

Arguments

x

object to be created as Dat type

format

a character vector of date-time formats. Default is "%-m/%-d/%Y"

skip_stats

a logical evaluating to TRUE or FALSE indicating whether variable stats should be calculated and added to the hd_Dat object. The stats are n of unique categories, n of NA values, percentage of NA values and a frequency table.

Examples

x <-   c("2000-12-04","2010-20-04")
dat <- Dat(x, format = "%Y-%d-%m")
dat
class(dat)
attr(dat, "stats")


jpmarindiaz/homodatum documentation built on May 1, 2023, 7:24 p.m.