With this update, you have the option to use quiet to prevent the function from generating warnings. By default, warnings will be produced unless you set it to TRUE.
Closes #90
I have also made several tweaks to speed up the code:
Postcodes are made uppercase earlier. This means we can use a simpler (and faster) regex, it does, however, mean that the warnings about lowercase inputs will now always appear even if the input is invalid for a different reason: e.g. james would have previously returned NA with a warning about it being in an invalid format, that will still happen but now you will also get a warning saying it will be made upper case.
The warning about lowercase values is now more informative with a count of the 'bad' values.
I've simplified the removal of spaces by assuming it will only have spaces (and not tabs or other whitespace characters) in which case we don't need to use regex, which again is faster.
For the final case_when I've removed the usage of regex replacement in favour of a hardcoded substring replacement, this works the same and is faster but is a bit more more long-winded to type!
With this update, you have the option to use
quiet
to prevent the function from generating warnings. By default, warnings will be produced unless you set it toTRUE
.Closes #90
I have also made several tweaks to speed up the code:
james
would have previously returnedNA
with a warning about it being in an invalid format, that will still happen but now you will also get a warning saying it will be made upper case.case_when
I've removed the usage of regex replacement in favour of a hardcoded substring replacement, this works the same and is faster but is a bit more more long-winded to type!