utils_format_directory_raw {podcleaner}R Documentation

Format raw directory for further processing

Description

Takes a raw directory dataframe (just loaded), adds a column with the corresponding directory name, replaces all NA entries with an empty string, clear all entries of unwanted blank characters, format page number as integer, returns the output with the directory name column in first position.

Usage

utils_format_directory_raw(df, name)

Arguments

df

A raw directory dataframe as output by utils_load_directories_csv.

name

Directory name provided as a character string.

Value

A dataframe.

Examples

## Not run: 
  directory <- data.frame(
    page = c("71", "71"),
    surname = c("ABOT     ", " ABRCROMBIE"), forename = c("Wm.", "Alex"),
    occupation = c("wine and    spirit mercht", "    bkr"),
    addresses = c(
      "depot -; 1820 London    st. ; house, Mary hill.*",
      "workshop,,12 &;Dixon st.; residence,    Craigrownie, Cove.$   "
    ),
    stringsAsFactors = FALSE
  )
  utils_format_directory_raw(directory, "1861-1862")

## End(Not run)

[Package podcleaner version 0.1.2 Index]