adjust_outliers_knn: Adjusts outliers based off of geom_boxplot

Description Usage Arguments Examples

View source: R/adjust_outliers_knn.R

Description

This function adjusts outliers using the kNN algorithm

Usage

1
adjust_outliers_knn(dataframe, column)

Arguments

dataframe

Object of data table or dataframe

column

Column in question with double quotes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Example <- adjust_outliers_knn(dataframe,"AllVisits","impacts")

The original and imputed series can be compared with the below

plot<- Final_Data %>% 
ggplot(aes(x=Date,y=Imputed)) + #Where Imputed is the name of the imputed series
geom_line(col="black") +
geom_point()

comp_plot<- plot + geom_line(aes(x=Date,y=Original), col = "red") + 
geom_point() + ggtitle("Original vs Imputed Series") + ylab("Series") #Where Original is the name of the Original series
                  
ggplotly(comp_plot)

Muks91/OutlierAdjustment documentation built on Nov. 18, 2019, 5:50 a.m.