My code is following, however, ti does no change in my dataset:
# create a vector of outliers for the numeric factor
outliers <- boxplot(df$SupDem, plot = FALSE)$out
df_a[df_a$SupDem %in% outliers, "SupDem"] = NA
Also, I am not sure for what "SupDem" as a part of df_a[df_a$SupDem %in% outliers, "SupDem"] = NA
stands.