update_na_values {joyn}R Documentation

Update NA and/or values

Description

The function updates NAs and/or values in the following way:

Usage

update_na_values(
  dt,
  var,
  reportvar = getOption("joyn.reportvar"),
  suffixes = getOption("joyn.suffixes"),
  rep_NAs = FALSE,
  rep_values = FALSE
)

Arguments

dt

joined data.table

var

variable(s) to be updated

reportvar

character: Name of reporting variable. Default is ".joyn". This is the same as variable "_merge" in Stata after performing a merge. If FALSE or NULL, the reporting variable will be excluded from the final table, though a summary of the join will be display after concluding.

suffixes

A character(2) specifying the suffixes to be used for making non-by column names unique. The suffix behaviour works in a similar fashion as the base::merge method does.

rep_NAs

inherited from joyn update_NAs

rep_values

inherited from joyn update_values

Value

data.table


[Package joyn version 0.2.4 Index]