guess_missing_entries: Guess Missing Entries

Description Usage Arguments Details Value Examples

View source: R/guess_missing_entries.R

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

1

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

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

rOpenGov/bibliographica documentation built on July 17, 2018, 8:20 a.m.