guess_missing_entries: Guess Missing Entries

guess_missing_entriesR Documentation

Guess Missing Entries

Description

Fill in missing values. This function assumes that entries of the id but available in others. The missing data will be filled based on the available values. Ambiguous cases (same id but multiple values) are ignored.

Usage

guess_missing_entries(id, values)

Arguments

id

identifier vector

values

corresponding values with potentially missing information (NAs)

Details

For instance, we may have authors and author life years (birth and death). The life years may be available for a given author in some entries and missing in others. When the information is unique, this function fills the missing entries where possible. The function checks that the available life years for the given id (author in this example) are unique (ie. to avoid ambiguous mappings, for instance distinct authors with identical name but different birth year). For unique id-value relation, use the unique value to fill in the missing entries for the same id)

Value

A vector with augmented values

Examples

## Not run: guess_missing_entries(
  id = c("Tom", "Tom", "Pete", "Pete", "Pete"),
  	                 values = c(1, NA, 2, 3, NA))
## End(Not run)

COMHIS/bibliographica documentation built on April 11, 2022, 3:40 p.m.