Overview

homodatum helps to manage dataframes in a more human way. This package mainly adds information to data frames (metadata) by creating new classes for variables (hdTypes) and dataframes (hdFringe) and add them more descriptive properties.

Installation

Install the development version of makeup from GitHub with:

# install.packages("devtools")
remotes::install_github("datasketch/homodatum")

Example

This is a basic example which shows you how this packages work:

Let´s load homodatum package

library(homodatum)

New type of values

One of the main properties of this package is to add new type of variables, in order to offer ones with (more) metadata and information. The valid available variable new types from homodatum can be viewed with available_hdTypes():

hdType_table <- tibble::tribble(
          ~`id`,        ~`label`,
          "___",          "Null",
          "Uid",           "Uid",
          "Cat",   "Categorical",
          "Bin",        "Binary",
          "Seq",    "Sequential",
          "Num",       "Numeric",
          "Pct",    "Percentage",
          "Dst",  "Distribution",
          "Dat",          "Date",
          "Yea",          "Year",
          "Mon",         "Month",
          "Day",           "Day",
          "Wdy",   "Day of week",
          "Ywe",  "Week in year",
          "Dtm",     "Date time",
          "Hms",      "Time HMS",
          "Min",       "Minutes",
          "Sec",       "Seconds",
          "Hie",     "Hierarchy",
          "Grp",         "Group",
          "Txt",          "Text",
          "Mny",         "Money",
          "Gnm",      "Geo name",
          "Gcd",      "Geo code",
          "Glt",  "Geo latitude",
          "Gln", "Geo longitude",
          "Img",         "Image",
          "Aud",         "Audio") 

hdType_table |> 
  knitr::kable(format = "html",
               caption = "Available hdTypes for variables")


New type of data frame

In order to offer a more detailed information about a data frame, homodatum offers the function fringe(), which takes a data frame and converts it into a more informative object adding properties such as a dictionary, value type information, data frame name and description and several summary calculation from de variables, depending on their type.

Creating a fringe object:

# Create a dataframe
df <- data.frame(name = c("Roberta", "Ruby", "Roberta", "Maria"),
                 age  = c(98, 43, 98, 12))

# Create a fringe object
fr <- fringe(df)

This is how it looks with all the properties added:

str(fr)


You can inspect specifics attibutes of the fringe object such as:

fr$data
fr$dic
fr$stats

Learn about the many ways to work with formatting dates values in vignette("set-name")



datasketch/homodatum documentation built on May 1, 2023, 12:17 a.m.