knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Load the cleaninginspectoR library

library("cleaninginspectoR")
library("knitr")

Example data frame

Here we create some fake data for illustration purposes. It is not important to understand this; we keep it in so you can run the example yourself if you like. The dataset contains:

testdf <- data.frame(a= c(runif(98),7287,-100),
                   b=sample(letters,100,T),
                   uuid=c(1:98, 4,20),
                   water.source.other = c(rep(NA,98),"neighbour's well","neighbour's well"),
                   GPS.lat = runif(100)
                   )

Perform all available cleaning inspections

The function inspect_all runs all cleaning checks that are available.

inspect_all(testdf, uuid.column.name = "uuid")
kable(inspect_all(testdf, uuid.column.name = "uuid"))

For unusual UUID column names

One of the things inspect_all does is to look for duplicates in the first column containing the word "uuid". If your ID column has a different name, you can specify it in the second parameter:

inspect_all(df = testdf, uuid.column.name = "b")
kable(inspect_all(df = testdf, uuid.column.name = "b"))

More Details

For more information and individual check functions, see the detailed example.



ellieallien/cleaninginspectoR documentation built on July 18, 2019, 12:30 p.m.