Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert -1 values to NA #104

Open
Robinlovelace opened this issue Aug 21, 2019 · 1 comment
Open

Convert -1 values to NA #104

Robinlovelace opened this issue Aug 21, 2019 · 1 comment
Milestone

Comments

@Robinlovelace
Copy link
Member

As that's what it means in all cases.

@Robinlovelace Robinlovelace added this to the 1.2.0 milestone Oct 23, 2019
@Robinlovelace
Copy link
Member Author

Another example of this:

v = stats19::get_stats19(year = 2019, type = "vehicles")
#> Files identified: DfTRoadSafety_Vehicles_2019.zip
#>    http://data.dft.gov.uk.s3.amazonaws.com/road-accidents-safety-data/DfTRoadSafety_Vehicles_2019.zip
#> Data already exists in data_dir, not downloading
#> Data saved at ~/stats19-data/DfTRoadSafety_Vehicles_2019/Road Safety Data- Vehicles 2019.csv
summary(v$age_of_vehicle == -1)
#>    Mode   FALSE    TRUE 
#> logical  154626   61755
skimr::skim(v$age_of_vehicle)
Data summary
Name v$age_of_vehicle
Number of rows 216381
Number of columns 1
_______________________
Column type frequency:
numeric 1
________________________
Group variables None

Data summary

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
data 0 1 5.6 6.2 -1 -1 4 10 94 ▇▁▁▁▁
v$age_of_vehicle[v$age_of_vehicle == -1] = NA
skimr::skim(v$age_of_vehicle)
Data summary
Name v$age_of_vehicle
Number of rows 216381
Number of columns 1
_______________________
Column type frequency:
numeric 1
________________________
Group variables None

Data summary

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
data 61755 0.71 8.23 5.43 1 4 8 12 94 ▇▁▁▁▁

Created on 2020-10-28 by the reprex package (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant