Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #191 and closes #192 by enhancing the
messy_linelist()
function.The
prop_missing
setting inmessy_linelist()
now introduces missing values to<data.frame>
cells not alreadyNA
, if themissing_value
specified isNA
(default). This replaces the random placement of missing values in the previous implementation ofmessy_linelist()
.The
.add_missing()
function is added which contains a more sophisticated approach to inserting user-specified missing values (missing_value
) into the line list<data.frame>
.<data.frame>
to make missing depending on themissing_value
and doesn't sampleNA
elements if themissing_value
isNA
.missing_value
and the type of the<data.frame>
column differ to avoid unwanted coercions, e.g.numeric
toDate
.int_as_word
setting inmessy_linelist()
has been updated toprop_int_as_word
to allow users to control the proportion ofinteger
values that are convert to words usingenglish::words()
.inconsistent_id
is added as a setting tomessy_linelist()
, which by default is off (FALSE
), but when switched on appends random three letter prefixes or suffixes to a random ~10% sample of$id
s.Input checking for
prop_missing
andmissing_value
is added tomessy_linelist()
.New unit tests are added to test the behaviour of
missing_value
inmessy_linelist()
since adding the internal.add_missing()
function.