I'm trying to delete NAs from a single column and also replace NAs with the median in a group of columns but when I complete the command it is not working, it just prints the entire dataset. There is no error message but the NAs are not removed. I've been stuck at this stage for a day now so any help would be appreciated :) The code I'm using is
#as there is only 1 NA in the month columns we will remove that row so that it does not get replaced with the mean
water3[!is.na(water3$Month),]
#replace NA values with the median on skewed columns
water3 %>%
mutate_if(is.numeric, function(x) ifelse(is.na(x), median(x, na.rm = T), x))