Closed BobBorges closed 6 months ago
I would expect we already have this functionality somewhere in the code.
We have increase_date_precision()
which will give you back a full date (either start/end or riksdag year, or 01-01 / 12-31) from an incomplete date, but it does nothing to an NA. The added function gets you back a likely end date from a start date if end is NA and vice-versa.
Could we refactor the functionality under the same function?
I think that would probably be better.
@BobBorges do we use the previous functionality somewhere? I.e. is a flag for handling NAs or not necessary?
The new functionality stops mps with incomplete start/end dates from getting dropped. I can't imagine why we would want to drop them, so i didn't put a flag, but I could.
Ok 👍 let's keep it this way then
Previously MPs with NA in the start or end cols were dropped while loading metadata via load_Corpus_metadata(). This fix tries to infer a missing date on the fly by the parliament year.