baumer-lab / wikitablr

Simple Reader for Wikipedia Tables
Other
0 stars 0 forks source link

Do we need add_na()? #8

Open beanumber opened 4 years ago

beanumber commented 4 years ago

I don't see what this function does that can't be done with dplyr::na_if(). Do we need it?

I guess we could have a function called replace_special() that calls this on special characters?

beanumber commented 4 years ago

What is the difference between add_na() and special_to_na()? Do we need both?

niannucci commented 4 years ago

I think add_na() converts empty cells in the dataframe to NA; special_to_na is a parameter within add_na() that gives the option of converting social characters to NA also, with the default being true.

beanumber commented 4 years ago

I think it should then be called empty_to_na() or blank_to_na() and should only do that. special_to_na() is already a separate function, which it should be.

niannucci commented 4 years ago

@beanumber to clarify- since empty_to_na() essentially does the same thing as na_if(wiki_table, ""), do we need it at all? Or should we get rid of that and just keep special_to_na()and the rest of the cleaning functions?

beanumber commented 4 years ago

How about if you write the one-line function, and we'll see if we like it?