Takes a dataframe object and returns a cleaned version with rows containing any NaN values dropped. Inspects the clean dataframe and prints a list of potential outliers for each explanatory variable.

clean_up(df)

Arguments

df

The dataframe on which the function will operate

Value

the same dataframe with all the NaN's removed along with a list of potential outliers

Examples

library(palmerpenguins)
results <- clean_up(penguins)
#> [1] "**The following potenital outliers are detected:**"
#> $bill_length_mm
#> numeric(0)
#> 
#> $bill_depth_mm
#> numeric(0)
#> 
#> $flipper_length_mm
#> integer(0)
#> 
#> $body_mass_g
#> integer(0)
#> 
#> $year
#> integer(0)
#> 
'**The following potential outliers are detected:**
$Variable X:
300, 301, 500, 1000
Variable Y:
6.42, 6.44, 58.52, 60.22'
#> [1] "**The following potential outliers are detected:**\n$Variable X:\n300, 301, 500, 1000\nVariable Y:\n6.42, 6.44, 58.52, 60.22"