#denuncias

library(readxl)
library(modelsummary)
## Warning: package 'modelsummary' was built under R version 4.3.3
## Version 2.0.0 of `modelsummary`, to be released soon, will introduce a
##   breaking change: The default table-drawing package will be `tinytable`
##   instead of `kableExtra`. All currently supported table-drawing packages
##   will continue to be supported for the foreseeable future, including
##   `kableExtra`, `gt`, `huxtable`, `flextable, and `DT`.
##   
##   You can always call the `config_modelsummary()` function to change the
##   default table-drawing package in persistent fashion. To try `tinytable`
##   now:
##   
##   config_modelsummary(factory_default = 'tinytable')
##   
##   To set the default back to `kableExtra`:
##   
##   config_modelsummary(factory_default = 'kableExtra')
denuncias <- read_excel("C:/Users/JHOJAN/Downloads/Lima2022 (1).xlsx", 
    col_types = c("text", "numeric"))
denuncias$Distrito <- gsub("[0-9]+", "", denuncias$Distrito)
denuncias$Distrito <- gsub("BREс", "BREÑA", denuncias$Distrito)

#residuos

library(readxl)
residuos <- read_excel("C:/Users/JHOJAN/Downloads/residuosPeru.xlsx", 
    col_types = c("numeric", "numeric", "numeric", 
        "text", "text", "text", "text", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric"))
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
lima_data <- residuos %>% filter(PROVINCIA == "LIMA")
lima_distritos_residuos <- lima_data %>%
  group_by(DISTRITO) %>%
  summarise(QRESIDUOS_NO_DOM = sum(QRESIDUOS_NO_DOM, na.rm = TRUE))
lima_distritos_residuos <- lima_distritos_residuos %>%
  rename(Distrito = DISTRITO)
lima_distritos_residuos$Distrito <- paste0(" ", lima_distritos_residuos$Distrito)
lima_distritos_residuos$Distrito <- gsub(" MAGDALENA VIEJA", " PUEBLO LIBRE", lima_distritos_residuos$Distrito)

#elecciones_municipales

library(readxl)
votos <- read_excel("C:/Users/JHOJAN/Downloads/Votos_muni.xlsx", 
    col_types = c("text", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric", "numeric", 
        "numeric", "numeric"))
## Warning: Coercing text to numeric in C2 / R2C3: '13.28'
## Warning: Coercing text to numeric in E2 / R2C5: '33.27'
## Warning: Coercing text to numeric in G2 / R2C7: '21.35'
## Warning: Coercing text to numeric in I2 / R2C9: '7.28'
## Warning: Coercing text to numeric in K2 / R2C11: '12.79'
## Warning: Coercing text to numeric in M2 / R2C13: '5.99'
## Warning: Coercing text to numeric in O2 / R2C15: '4.38'
## Warning: Coercing text to numeric in P2 / R2C16: '465'
## Warning: Coercing text to numeric in Q2 / R2C17: '1.67'
## Warning: Coercing text to numeric in C3 / R3C3: '17.49'
## Warning: Coercing text to numeric in E3 / R3C5: '29.99'
## Warning: Coercing text to numeric in G3 / R3C7: '15.87'
## Warning: Coercing text to numeric in I3 / R3C9: '8.51'
## Warning: Coercing text to numeric in K3 / R3C11: '7.97'
## Warning: Coercing text to numeric in M3 / R3C13: '7.66'
## Warning: Coercing text to numeric in O3 / R3C15: '10.01'
## Warning: Coercing text to numeric in Q3 / R3C17: '2.50'
## Warning: Coercing text to numeric in C4 / R4C3: '36.92'
## Warning: Coercing text to numeric in E4 / R4C5: '18.34'
## Warning: Coercing text to numeric in G4 / R4C7: '20.37'
## Warning: Coercing text to numeric in I4 / R4C9: '8.82'
## Warning: Coercing text to numeric in K4 / R4C11: '6.98'
## Warning: Coercing text to numeric in M4 / R4C13: '5.18'
## Warning: Coercing text to numeric in N4 / R4C14: '845'
## Warning: Coercing text to numeric in O4 / R4C15: '2.69'
## Warning: Coercing text to numeric in P4 / R4C16: '223'
## Warning: Coercing text to numeric in Q4 / R4C17: '0.71'
## Warning: Coercing text to numeric in C5 / R5C3: '31.15'
## Warning: Coercing text to numeric in E5 / R5C5: '25.61'
## Warning: Coercing text to numeric in G5 / R5C7: '19.23'
## Warning: Coercing text to numeric in I5 / R5C9: '11.30'
## Warning: Coercing text to numeric in K5 / R5C11: '3.39'
## Warning: Coercing text to numeric in M5 / R5C13: '5.23'
## Warning: Coercing text to numeric in O5 / R5C15: '3.34'
## Warning: Coercing text to numeric in P5 / R5C16: '552'
## Warning: Coercing text to numeric in Q5 / R5C17: '0.76'
## Warning: Coercing text to numeric in C6 / R6C3: '19.24'
## Warning: Coercing text to numeric in E6 / R6C5: '27.82'
## Warning: Coercing text to numeric in G6 / R6C7: '21.12'
## Warning: Coercing text to numeric in I6 / R6C9: '9.94'
## Warning: Coercing text to numeric in K6 / R6C11: '10.40'
## Warning: Coercing text to numeric in M6 / R6C13: '7.37'
## Warning: Coercing text to numeric in O6 / R6C15: '1.81'
## Warning: Coercing text to numeric in Q6 / R6C17: '2.30'
## Warning: Coercing text to numeric in C7 / R7C3: '28.42'
## Warning: Coercing text to numeric in E7 / R7C5: '22.74'
## Warning: Coercing text to numeric in G7 / R7C7: '18.78'
## Warning: Coercing text to numeric in I7 / R7C9: '10.56'
## Warning: Coercing text to numeric in K7 / R7C11: '4.56'
## Warning: Coercing text to numeric in M7 / R7C13: '6.07'
## Warning: Coercing text to numeric in O7 / R7C15: '5.87'
## Warning: Coercing text to numeric in P7 / R7C16: '855'
## Warning: Coercing text to numeric in Q7 / R7C17: '3.00'
## Warning: Coercing text to numeric in C8 / R8C3: '25.27'
## Warning: Coercing text to numeric in E8 / R8C5: '24.20'
## Warning: Coercing text to numeric in G8 / R8C7: '20.36'
## Warning: Coercing text to numeric in I8 / R8C9: '10.53'
## Warning: Coercing text to numeric in K8 / R8C11: '10.68'
## Warning: Coercing text to numeric in M8 / R8C13: '5.61'
## Warning: Coercing text to numeric in O8 / R8C15: '2.27'
## Warning: Coercing text to numeric in C9 / R9C3: '20.89'
## Warning: Coercing text to numeric in E9 / R9C5: '35.16'
## Warning: Coercing text to numeric in G9 / R9C7: '23.67'
## Warning: Coercing text to numeric in I9 / R9C9: '6.11'
## Warning: Coercing text to numeric in J9 / R9C10: '821'
## Warning: Coercing text to numeric in K9 / R9C11: '4.30'
## Warning: Coercing text to numeric in M9 / R9C13: '6.80'
## Warning: Coercing text to numeric in N9 / R9C14: '279'
## Warning: Coercing text to numeric in O9 / R9C15: '1.46'
## Warning: Coercing text to numeric in P9 / R9C16: '310'
## Warning: Coercing text to numeric in Q9 / R9C17: '1.62'
## Warning: Coercing text to numeric in E10 / R10C5: '25.52'
## Warning: Coercing text to numeric in G10 / R10C7: '21.35'
## Warning: Coercing text to numeric in I10 / R10C9: '13.72'
## Warning: Coercing text to numeric in K10 / R10C11: '7.50'
## Warning: Coercing text to numeric in M10 / R10C13: '7.17'
## Warning: Coercing text to numeric in O10 / R10C15: '3.93'
## Warning: Coercing text to numeric in Q10 / R10C17: '1.44'
## Warning: Coercing text to numeric in C11 / R11C3: '18.28'
## Warning: Coercing text to numeric in E11 / R11C5: '35.50'
## Warning: Coercing text to numeric in G11 / R11C7: '14.92'
## Warning: Coercing text to numeric in I11 / R11C9: '10.20'
## Warning: Coercing text to numeric in K11 / R11C11: '9.72'
## Warning: Coercing text to numeric in M11 / R11C13: '6.38'
## Warning: Coercing text to numeric in O11 / R11C15: '3.06'
## Warning: Coercing text to numeric in Q11 / R11C17: '1.94'
## Warning: Coercing text to numeric in C12 / R12C3: '20.65'
## Warning: Coercing text to numeric in E12 / R12C5: '29.02'
## Warning: Coercing text to numeric in G12 / R12C7: '23.58'
## Warning: Coercing text to numeric in I12 / R12C9: '10.09'
## Warning: Coercing text to numeric in K12 / R12C11: '5.12'
## Warning: Coercing text to numeric in M12 / R12C13: '6.43'
## Warning: Coercing text to numeric in O12 / R12C15: '3.07'
## Warning: Coercing text to numeric in Q12 / R12C17: '2.01'
## Warning: Coercing text to numeric in C13 / R13C3: '40.79'
## Warning: Coercing text to numeric in E13 / R13C5: '15.58'
## Warning: Coercing text to numeric in G13 / R13C7: '19.88'
## Warning: Coercing text to numeric in I13 / R13C9: '13.88'
## Warning: Coercing text to numeric in K13 / R13C11: '2.47'
## Warning: Coercing text to numeric in M13 / R13C13: '3.52'
## Warning: Coercing text to numeric in O13 / R13C15: '3.30'
## Warning: Coercing text to numeric in P13 / R13C16: '461'
## Warning: Coercing text to numeric in Q13 / R13C17: '0.58'
## Warning: Coercing text to numeric in C14 / R14C3: '46.75'
## Warning: Coercing text to numeric in E14 / R14C5: '15.66'
## Warning: Coercing text to numeric in G14 / R14C7: '16.61'
## Warning: Coercing text to numeric in I14 / R14C9: '8.86'
## Warning: Coercing text to numeric in K14 / R14C11: '3.33'
## Warning: Coercing text to numeric in M14 / R14C13: '3.88'
## Warning: Coercing text to numeric in O14 / R14C15: '4.28'
## Warning: Coercing text to numeric in P14 / R14C16: '733'
## Warning: Coercing text to numeric in Q14 / R14C17: '0.63'
## Warning: Coercing text to numeric in C15 / R15C3: '29.61'
## Warning: Coercing text to numeric in E15 / R15C5: '24.42'
## Warning: Coercing text to numeric in G15 / R15C7: '23.93'
## Warning: Coercing text to numeric in I15 / R15C9: '9.44'
## Warning: Coercing text to numeric in M15 / R15C13: '5.18'
## Warning: Coercing text to numeric in O15 / R15C15: '1.69'
## Warning: Coercing text to numeric in Q15 / R15C17: '1.44'
## Warning: Coercing text to numeric in C16 / R16C3: '29.25'
## Warning: Coercing text to numeric in E16 / R16C5: '24.86'
## Warning: Coercing text to numeric in G16 / R16C7: '20.46'
## Warning: Coercing text to numeric in I16 / R16C9: '12.10'
## Warning: Coercing text to numeric in K16 / R16C11: '3.60'
## Warning: Coercing text to numeric in M16 / R16C13: '6.16'
## Warning: Coercing text to numeric in O16 / R16C15: '2.12'
## Warning: Coercing text to numeric in Q16 / R16C17: '1.46'
## Warning: Coercing text to numeric in E17 / R17C5: '17.04'
## Warning: Coercing text to numeric in G17 / R17C7: '22.16'
## Warning: Coercing text to numeric in I17 / R17C9: '10.69'
## Warning: Coercing text to numeric in K17 / R17C11: '3.18'
## Warning: Coercing text to numeric in M17 / R17C13: '4.39'
## Warning: Coercing text to numeric in O17 / R17C15: '2.50'
## Warning: Coercing text to numeric in P17 / R17C16: '527'
## Warning: Coercing text to numeric in Q17 / R17C17: '0.93'
## Warning: Coercing text to numeric in E18 / R18C5: '28.19'
## Warning: Coercing text to numeric in G18 / R18C7: '18.16'
## Warning: Coercing text to numeric in I18 / R18C9: '13.14'
## Warning: Coercing text to numeric in K18 / R18C11: '3.89'
## Warning: Coercing text to numeric in M18 / R18C13: '7.94'
## Warning: Coercing text to numeric in O18 / R18C15: '2.65'
## Warning: Coercing text to numeric in Q18 / R18C17: '1.54'
## Warning: Coercing text to numeric in E19 / R19C5: '25.11'
## Warning: Coercing text to numeric in G19 / R19C7: '15.34'
## Warning: Coercing text to numeric in I19 / R19C9: '10.65'
## Warning: Coercing text to numeric in K19 / R19C11: '9.48'
## Warning: Coercing text to numeric in M19 / R19C13: '15.58'
## Warning: Coercing text to numeric in O19 / R19C15: '2.54'
## Warning: Coercing text to numeric in Q19 / R19C17: '2.13'
## Warning: Coercing text to numeric in E20 / R20C5: '20.28'
## Warning: Coercing text to numeric in G20 / R20C7: '23.38'
## Warning: Coercing text to numeric in I20 / R20C9: '8.55'
## Warning: Coercing text to numeric in K20 / R20C11: '17.33'
## Warning: Coercing text to numeric in M20 / R20C13: '4.96'
## Warning: Coercing text to numeric in N20 / R20C14: '727'
## Warning: Coercing text to numeric in O20 / R20C15: '1.48'
## Warning: Coercing text to numeric in P20 / R20C16: '474'
## Warning: Coercing text to numeric in Q20 / R20C17: '0.97'
## Warning: Coercing text to numeric in E21 / R21C5: '13.57'
## Warning: Coercing text to numeric in G21 / R21C7: '19.81'
## Warning: Coercing text to numeric in I21 / R21C9: '10.54'
## Warning: Coercing text to numeric in K21 / R21C11: '8.13'
## Warning: Coercing text to numeric in M21 / R21C13: '2.75'
## Warning: Coercing text to numeric in N21 / R21C14: '820'
## Warning: Coercing text to numeric in O21 / R21C15: '1.64'
## Warning: Coercing text to numeric in P21 / R21C16: '214'
## Warning: Coercing text to numeric in Q21 / R21C17: '0.43'
## Warning: Coercing text to numeric in E22 / R22C5: '9.62'
## Warning: Coercing text to numeric in G22 / R22C7: '18.68'
## Warning: Coercing text to numeric in I22 / R22C9: '8.42'
## Warning: Coercing text to numeric in K22 / R22C11: '2.78'
## Warning: Coercing text to numeric in M22 / R22C13: '2.16'
## Warning: Coercing text to numeric in O22 / R22C15: '2.08'
## Warning: Coercing text to numeric in P22 / R22C16: '347'
## Warning: Coercing text to numeric in Q22 / R22C17: '0.41'
## Warning: Coercing text to numeric in C23 / R23C3: '12.30'
## Warning: Coercing text to numeric in E23 / R23C5: '24.69'
## Warning: Coercing text to numeric in G23 / R23C7: '27.61'
## Warning: Coercing text to numeric in I23 / R23C9: '7.47'
## Warning: Coercing text to numeric in K23 / R23C11: '17.16'
## Warning: Coercing text to numeric in M23 / R23C13: '7.36'
## Warning: Coercing text to numeric in O23 / R23C15: '2.00'
## Warning: Coercing text to numeric in P23 / R23C16: '825'
## Warning: Coercing text to numeric in Q23 / R23C17: '1.41'
## Warning: Coercing text to numeric in E24 / R24C5: '22.98'
## Warning: Coercing text to numeric in G24 / R24C7: '22.63'
## Warning: Coercing text to numeric in I24 / R24C9: '16.54'
## Warning: Coercing text to numeric in J24 / R24C10: '768'
## Warning: Coercing text to numeric in K24 / R24C11: '8.70'
## Warning: Coercing text to numeric in L24 / R24C12: '796'
## Warning: Coercing text to numeric in M24 / R24C13: '9.02'
## Warning: Coercing text to numeric in N24 / R24C14: '763'
## Warning: Coercing text to numeric in O24 / R24C15: '8.65'
## Warning: Coercing text to numeric in P24 / R24C16: '214'
## Warning: Coercing text to numeric in Q24 / R24C17: '2.42'
## Warning: Coercing text to numeric in C25 / R25C3: '42.52'
## Warning: Coercing text to numeric in E25 / R25C5: '14.85'
## Warning: Coercing text to numeric in G25 / R25C7: '19.95'
## Warning: Coercing text to numeric in I25 / R25C9: '11.76'
## Warning: Coercing text to numeric in K25 / R25C11: '4.23'
## Warning: Coercing text to numeric in M25 / R25C13: '3.74'
## Warning: Coercing text to numeric in O25 / R25C15: '2.43'
## Warning: Coercing text to numeric in P25 / R25C16: '368'
## Warning: Coercing text to numeric in Q25 / R25C17: '0.54'
## Warning: Coercing text to numeric in C26 / R26C3: '23.58'
## Warning: Coercing text to numeric in E26 / R26C5: '20.53'
## Warning: Coercing text to numeric in G26 / R26C7: '23.67'
## Warning: Coercing text to numeric in I26 / R26C9: '10.00'
## Warning: Coercing text to numeric in K26 / R26C11: '7.77'
## Warning: Coercing text to numeric in M26 / R26C13: '7.91'
## Warning: Coercing text to numeric in O26 / R26C15: '5.01'
## Warning: Coercing text to numeric in Q26 / R26C17: '1.52'
## Warning: Coercing text to numeric in C27 / R27C3: '29.94'
## Warning: Coercing text to numeric in D27 / R27C4: '950'
## Warning: Coercing text to numeric in E27 / R27C5: '19.31'
## Warning: Coercing text to numeric in G27 / R27C7: '22.30'
## Warning: Coercing text to numeric in H27 / R27C8: '294'
## Warning: Coercing text to numeric in I27 / R27C9: '5.97'
## Warning: Coercing text to numeric in J27 / R27C10: '408'
## Warning: Coercing text to numeric in K27 / R27C11: '8.29'
## Warning: Coercing text to numeric in L27 / R27C12: '155'
## Warning: Coercing text to numeric in M27 / R27C13: '3.15'
## Warning: Coercing text to numeric in N27 / R27C14: '507'
## Warning: Coercing text to numeric in O27 / R27C15: '10.30'
## Warning: Coercing text to numeric in P27 / R27C16: '35'
## Warning: Coercing text to numeric in Q27 / R27C17: '0.71'
## Warning: Coercing text to numeric in C28 / R28C3: '25.67'
## Warning: Coercing text to numeric in D28 / R28C4: '921'
## Warning: Coercing text to numeric in E28 / R28C5: '20.61'
## Warning: Coercing text to numeric in F28 / R28C6: '877'
## Warning: Coercing text to numeric in G28 / R28C7: '19.62'
## Warning: Coercing text to numeric in H28 / R28C8: '585'
## Warning: Coercing text to numeric in I28 / R28C9: '13.09'
## Warning: Coercing text to numeric in J28 / R28C10: '493'
## Warning: Coercing text to numeric in K28 / R28C11: '11.03'
## Warning: Coercing text to numeric in L28 / R28C12: '177'
## Warning: Coercing text to numeric in M28 / R28C13: '3.96'
## Warning: Coercing text to numeric in N28 / R28C14: '222'
## Warning: Coercing text to numeric in O28 / R28C15: '4.96'
## Warning: Coercing text to numeric in P28 / R28C16: '46'
## Warning: Coercing text to numeric in Q28 / R28C17: '1.03'
## Warning: Coercing text to numeric in C29 / R29C3: '26.47'
## Warning: Coercing text to numeric in E29 / R29C5: '29.21'
## Warning: Coercing text to numeric in G29 / R29C7: '16.46'
## Warning: Coercing text to numeric in I29 / R29C9: '14.41'
## Warning: Coercing text to numeric in K29 / R29C11: '4.16'
## Warning: Coercing text to numeric in M29 / R29C13: '5.47'
## Warning: Coercing text to numeric in O29 / R29C15: '2.36'
## Warning: Coercing text to numeric in Q29 / R29C17: '1.29'
## Warning: Coercing text to numeric in C30 / R30C3: '16.68'
## Warning: Coercing text to numeric in E30 / R30C5: '23.77'
## Warning: Coercing text to numeric in G30 / R30C7: '21.60'
## Warning: Coercing text to numeric in H30 / R30C8: '304'
## Warning: Coercing text to numeric in I30 / R30C9: '6.29'
## Warning: Coercing text to numeric in J30 / R30C10: '167'
## Warning: Coercing text to numeric in K30 / R30C11: '3.86'
## Warning: Coercing text to numeric in L30 / R30C12: '179'
## Warning: Coercing text to numeric in M30 / R30C13: '3.70'
## Warning: Coercing text to numeric in O30 / R30C15: '21.14'
## Warning: Coercing text to numeric in P30 / R30C16: '35'
## Warning: Coercing text to numeric in Q30 / R30C17: '0.72'
## Warning: Coercing text to numeric in C31 / R31C3: '55.02'
## Warning: Coercing text to numeric in E31 / R31C5: '10.99'
## Warning: Coercing text to numeric in G31 / R31C7: '18.42'
## Warning: Coercing text to numeric in I31 / R31C9: '8.93'
## Warning: Coercing text to numeric in K31 / R31C11: '2.25'
## Warning: Coercing text to numeric in M31 / R31C13: '2.40'
## Warning: Coercing text to numeric in O31 / R31C15: '1.59'
## Warning: Coercing text to numeric in P31 / R31C16: '323'
## Warning: Coercing text to numeric in Q31 / R31C17: '0.37'
## Warning: Coercing text to numeric in C32 / R32C3: '61.64'
## Warning: Coercing text to numeric in E32 / R32C5: '7.98'
## Warning: Coercing text to numeric in G32 / R32C7: '16.66'
## Warning: Coercing text to numeric in I32 / R32C9: '7.39'
## Warning: Coercing text to numeric in J32 / R32C10: '897'
## Warning: Coercing text to numeric in K32 / R32C11: '1.87'
## Warning: Coercing text to numeric in L32 / R32C12: '875'
## Warning: Coercing text to numeric in M32 / R32C13: '1.83'
## Warning: Coercing text to numeric in O32 / R32C15: '2.33'
## Warning: Coercing text to numeric in P32 / R32C16: '126'
## Warning: Coercing text to numeric in Q32 / R32C17: '0.26'
## Warning: Coercing text to numeric in C33 / R33C3: '20.07'
## Warning: Coercing text to numeric in E33 / R33C5: '27.21'
## Warning: Coercing text to numeric in G33 / R33C7: '19.37'
## Warning: Coercing text to numeric in I33 / R33C9: '11.09'
## Warning: Coercing text to numeric in K33 / R33C11: '8.37'
## Warning: Coercing text to numeric in M33 / R33C13: '7.99'
## Warning: Coercing text to numeric in O33 / R33C15: '3.83'
## Warning: Coercing text to numeric in Q33 / R33C17: '2.03'
## Warning: Coercing text to numeric in C34 / R34C3: '23.14'
## Warning: Coercing text to numeric in E34 / R34C5: '27.51'
## Warning: Coercing text to numeric in G34 / R34C7: '16.18'
## Warning: Coercing text to numeric in I34 / R34C9: '12.47'
## Warning: Coercing text to numeric in K34 / R34C11: '8.56'
## Warning: Coercing text to numeric in M34 / R34C13: '7.37'
## Warning: Coercing text to numeric in O34 / R34C15: '3.50'
## Warning: Coercing text to numeric in Q34 / R34C17: '1.24'
## Warning: Coercing text to numeric in C35 / R35C3: '32.55'
## Warning: Coercing text to numeric in E35 / R35C5: '22.40'
## Warning: Coercing text to numeric in G35 / R35C7: '21.19'
## Warning: Coercing text to numeric in I35 / R35C9: '9.47'
## Warning: Coercing text to numeric in K35 / R35C11: '4.68'
## Warning: Coercing text to numeric in M35 / R35C13: '5.22'
## Warning: Coercing text to numeric in O35 / R35C15: '3.44'
## Warning: Coercing text to numeric in P35 / R35C16: '437'
## Warning: Coercing text to numeric in Q35 / R35C17: '1.02'
## Warning: Coercing text to numeric in C36 / R36C3: '23.97'
## Warning: Coercing text to numeric in E36 / R36C5: '31.66'
## Warning: Coercing text to numeric in G36 / R36C7: '18.52'
## Warning: Coercing text to numeric in I36 / R36C9: '11.95'
## Warning: Coercing text to numeric in K36 / R36C11: '4.53'
## Warning: Coercing text to numeric in M36 / R36C13: '5.54'
## Warning: Coercing text to numeric in O36 / R36C15: '2.24'
## Warning: Coercing text to numeric in Q36 / R36C17: '1.56'
## Warning: Coercing text to numeric in C37 / R37C3: '41.66'
## Warning: Coercing text to numeric in E37 / R37C5: '15.44'
## Warning: Coercing text to numeric in G37 / R37C7: '18.18'
## Warning: Coercing text to numeric in I37 / R37C9: '11.99'
## Warning: Coercing text to numeric in K37 / R37C11: '2.72'
## Warning: Coercing text to numeric in M37 / R37C13: '2.99'
## Warning: Coercing text to numeric in O37 / R37C15: '6.45'
## Warning: Coercing text to numeric in P37 / R37C16: '549'
## Warning: Coercing text to numeric in Q37 / R37C17: '0.54'
## Warning: Coercing text to numeric in C38 / R38C3: '18.49'
## Warning: Coercing text to numeric in E38 / R38C5: '31.89'
## Warning: Coercing text to numeric in G38 / R38C7: '14.95'
## Warning: Coercing text to numeric in I38 / R38C9: '10.89'
## Warning: Coercing text to numeric in K38 / R38C11: '12.14'
## Warning: Coercing text to numeric in M38 / R38C13: '7.37'
## Warning: Coercing text to numeric in O38 / R38C15: '2.40'
## Warning: Coercing text to numeric in Q38 / R38C17: '1.81'
## Warning: Coercing text to numeric in C39 / R39C3: '43.02'
## Warning: Coercing text to numeric in E39 / R39C5: '13.55'
## Warning: Coercing text to numeric in F39 / R39C6: '222'
## Warning: Coercing text to numeric in G39 / R39C7: '22.96'
## Warning: Coercing text to numeric in H39 / R39C8: '69'
## Warning: Coercing text to numeric in I39 / R39C9: '7.14'
## Warning: Coercing text to numeric in J39 / R39C10: '20'
## Warning: Coercing text to numeric in K39 / R39C11: '2.07'
## Warning: Coercing text to numeric in L39 / R39C12: '51'
## Warning: Coercing text to numeric in M39 / R39C13: '5.27'
## Warning: Coercing text to numeric in N39 / R39C14: '49'
## Warning: Coercing text to numeric in O39 / R39C15: '5.07'
## Warning: Coercing text to numeric in P39 / R39C16: '9'
## Warning: Coercing text to numeric in Q39 / R39C17: '0.93'
## Warning: Coercing text to numeric in C40 / R40C3: '14.33'
## Warning: Coercing text to numeric in E40 / R40C5: '29.25'
## Warning: Coercing text to numeric in G40 / R40C7: '18.02'
## Warning: Coercing text to numeric in I40 / R40C9: '10.23'
## Warning: Coercing text to numeric in J40 / R40C10: '703'
## Warning: Coercing text to numeric in K40 / R40C11: '6.39'
## Warning: Coercing text to numeric in L40 / R40C12: '676'
## Warning: Coercing text to numeric in M40 / R40C13: '6.15'
## Warning: Coercing text to numeric in O40 / R40C15: '11.63'
## Warning: Coercing text to numeric in P40 / R40C16: '436'
## Warning: Coercing text to numeric in Q40 / R40C17: '3.96'
## Warning: Coercing text to numeric in C41 / R41C3: '45.81'
## Warning: Coercing text to numeric in E41 / R41C5: '14.38'
## Warning: Coercing text to numeric in G41 / R41C7: '18.39'
## Warning: Coercing text to numeric in I41 / R41C9: '9.51'
## Warning: Coercing text to numeric in K41 / R41C11: '3.76'
## Warning: Coercing text to numeric in M41 / R41C13: '2.91'
## Warning: Coercing text to numeric in O41 / R41C15: '4.61'
## Warning: Coercing text to numeric in Q41 / R41C17: '0.60'
## Warning: Coercing text to numeric in C42 / R42C3: '37.11'
## Warning: Coercing text to numeric in E42 / R42C5: '18.46'
## Warning: Coercing text to numeric in G42 / R42C7: '21.33'
## Warning: Coercing text to numeric in I42 / R42C9: '10.33'
## Warning: Coercing text to numeric in K42 / R42C11: '6.88'
## Warning: Coercing text to numeric in M42 / R42C13: '3.34'
## Warning: Coercing text to numeric in O42 / R42C15: '1.60'
## Warning: Coercing text to numeric in P42 / R42C16: '639'
## Warning: Coercing text to numeric in Q42 / R42C17: '0.92'
## Warning: Coercing text to numeric in C43 / R43C3: '17.99'
## Warning: Coercing text to numeric in E43 / R43C5: '33.82'
## Warning: Coercing text to numeric in G43 / R43C7: '13.76'
## Warning: Coercing text to numeric in I43 / R43C9: '10.97'
## Warning: Coercing text to numeric in K43 / R43C11: '12.08'
## Warning: Coercing text to numeric in M43 / R43C13: '7.92'
## Warning: Coercing text to numeric in O43 / R43C15: '2.23'
## Warning: Coercing text to numeric in Q43 / R43C17: '1.19'
## Warning: Coercing text to numeric in C44 / R44C3: '20.61'
## Warning: Coercing text to numeric in E44 / R44C5: '27.70'
## Warning: Coercing text to numeric in G44 / R44C7: '18.56'
## Warning: Coercing text to numeric in I44 / R44C9: '11.37'
## Warning: Coercing text to numeric in K44 / R44C11: '10.30'
## Warning: Coercing text to numeric in M44 / R44C13: '7.19'
## Warning: Coercing text to numeric in O44 / R44C15: '2.49'
## Warning: Coercing text to numeric in Q44 / R44C17: '1.76'
## Warning: Expecting numeric in B45 / R45C2: got '1.402.627'
## Warning: Coercing text to numeric in C45 / R45C3: '26.34'
## Warning: Expecting numeric in D45 / R45C4: got '1.349.725'
## Warning: Coercing text to numeric in E45 / R45C5: '25.35'
## Warning: Expecting numeric in F45 / R45C6: got '1.007.979'
## Warning: Coercing text to numeric in G45 / R45C7: '18.93'
## Warning: Coercing text to numeric in I45 / R45C9: '10.92'
## Warning: Coercing text to numeric in K45 / R45C11: '7.11'
## Warning: Coercing text to numeric in M45 / R45C13: '6.38'
## Warning: Coercing text to numeric in O45 / R45C15: '3.50'
## Warning: Coercing text to numeric in Q45 / R45C17: '1.47'
votos_limpio = select(votos, c(1:3))
votos_limpio <- lapply(votos_limpio, function(x) {
  if(is.character(x)) {
    iconv(x, to = "ASCII//TRANSLIT")
  } else {
    x
  }
})

votos_limpio <- as.data.frame(votos_limpio)
votos_limpio$Distrito = toupper(votos_limpio$Distrito)
votos_limpio <- votos_limpio[-nrow(votos_limpio), ]
votos_limpio$Distrito <- gsub("BRENA", "BREÑA", denuncias$Distrito)

#Juntar data

Hipotesis = merge(votos_limpio, denuncias, by = "Distrito", all.x = T)
datos_perdidos1 <- anti_join(votos_limpio, denuncias, by = "Distrito")
datos_perdidos1
## [1] Distrito RP.V     RP..    
## <0 rows> (or 0-length row.names)
Hipotesis_final = merge(Hipotesis, lima_distritos_residuos, by = "Distrito", all.x = T)
datos_perdidos2 <- anti_join(Hipotesis, lima_distritos_residuos, by = "Distrito")
datos_perdidos2
## [1] Distrito       RP.V           RP..           Tasa_denuncias
## <0 rows> (or 0-length row.names)
h1=formula(RP..~Tasa_denuncias+QRESIDUOS_NO_DOM)
rl1=lm(h1, data = Hipotesis_final)

model1=list('OLS asegurados (I)'=rl1)
modelsummary(model1, title = "Resumen de Regresion Lineal",
             stars = TRUE,
             output = "kableExtra")
Resumen de Regresion Lineal
 OLS asegurados (I)
(Intercept) 32.849***
(4.280)
Tasa_denuncias -0.006
(0.017)
QRESIDUOS_NO_DOM 0.000
(0.000)
Num.Obs. 43
R2 0.052
R2 Adj. 0.005
AIC 344.9
BIC 351.9
Log.Lik. -168.431
F 1.097
RMSE 12.16
+ p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001