Category: Uncategorized

  • General R

    Check NAs (taken from loop_Ventas) #check which columns have Nas nacols <- function(df) { colnames(df)[unlist(lapply(df, function(x) anyNA(x)))] } nacols(pre_Vtas_dtll_mov_full) #check NAs #updated NAs_pre_Vtas_dtll_mov_full <- pre_Vtas_dtll_mov_full %>% filter_all(any_vars( is.na(.))) data %>% drop_na() #Replace NAs by Col summarized_285_Ventas$Ventas_Trimestrales[is.na(summarized_285_Ventas$Ventas_Trimestrales)] <- 0.001 #Replace NAs all Cols TL_Vtas_dtll_mov_Establ_noSufixCostoNo0[is.na(TL_Vtas_dtll_mov_Establ_noSufixCostoNo0)] <- 0 #Replace NAs across all Numeric Cols with a 0 dat…