update_sample_col_CSIScontractID: Update a sample using a larger data frame.

View source: R/Standardization.R

update_sample_col_CSIScontractIDR Documentation

Update a sample using a larger data frame.

Description

Update a sample using a larger data frame.

Usage

update_sample_col_CSIScontractID(
  smp,
  full,
  col = NULL,
  drop_and_replace = FALSE
)

Arguments

smp

A data frame of contracts ready for statistical analysis, which must contain CSIScontractID.

full

A data frame of contracts with no key missing data and which must contain CSIScontractID.

col

Speific columns to add, if blank, add all in full missing from sample

drop_and_replace

If true, drop rows from sample missing from full. Then replace them with new rows from full.

Details

This is a function that updates samples using an updated version of the population, e.g. new columns, and adds them to existing samples. This might be used if a new column has been added from SQL or if NA values are found in a oolumn being used in. This isn't appropriate if the larger being drawn from has changed in make up, for example adding a new years data.

Value

The updated sample

Examples

update_sample_col_CSIScontractID(smp,def[complete,],drop_and_replace=TRUE)


CSISdefense/csis360 documentation built on April 29, 2024, 5:30 p.m.