integrity_check: Check success of type conversion: character to numeric

Description Usage Arguments Details Value

Description

Checks which values will convert to NA when converting a vector from character to numeric or integer.

Usage

1

Arguments

x

vector of length(x) > 1 and of nominally of is.character(x) == TRUE.

Details

The spreadsheets which come from the Office for National Statistics (ONS) often contain characters within what should be purely numeric fields. When we convert these to numeric these will be converted to NA, but it is not entirely clear after the fact which values have been converted or why. This function checks in advance which values will be converted to NA so we can confirm that it is nothing to worry about.

IT WILL ONLY RAISE A WARNING IF: there are new NAs, and any of these NAs, can cleanly be converted to numeric (wihtout turning to NA) - i.e. they are actually numbers, and not characters, which is what we would expect.

Value

Returns the conversion_issues vector, with following attribites: length(x) == length(conversion_issues) and is.logical(conversion_issues) == TRUE.


DCMSstats/eesectors documentation built on May 3, 2019, 2:43 p.m.