compu <- read.csv("~/Desktop/3.Semester/Statistik/apoyos.csv", sep=";", comment.char="#")
View(compu)

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

compu$Departamento = as.factor(compu$Departamento)

#compu = as.factor(compu$Departamento)
compu $Cantidad_personas = as.numeric(compu$Cantidad_personas)
## Warning: NAs introduced by coercion
typeof (compu$Cantidad_personas)
## [1] "double"
typeof (compu$Departamento)
## [1] "integer"
is.factor(compu$Departamento)
## [1] TRUE
summary(compu)
##              Departamento  Municipio         Agencia_Organizacion
##  Norte de Santander:132   Length:1099        Length:1099         
##  Nacional          :127   Class :character   Class :character    
##  La Guajira        : 85   Mode  :character   Mode  :character    
##                    : 70                                          
##  Nari\xf1o         : 66                                          
##  Amazonas          : 56                                          
##  (Other)           :563                                          
##  Institucion_donde_se_entrega Nombre_institucion    Insumo         
##  Length:1099                  Length:1099        Length:1099       
##  Class :character             Class :character   Class :character  
##  Mode  :character             Mode  :character   Mode  :character  
##                                                                    
##                                                                    
##                                                                    
##                                                                    
##  Unidad_de_medidad  Cantidad_personas    Disponible         Entregado        
##  Length:1099        Min.   :      1.0   Length:1099        Length:1099       
##  Class :character   1st Qu.:      6.8   Class :character   Class :character  
##  Mode  :character   Median :    100.0   Mode  :character   Mode  :character  
##                     Mean   :   1888.7                                        
##                     3rd Qu.:    350.0                                        
##                     Max.   :1250000.0                                        
##                     NA's   :59                                               
##  Fecha_de_entrega  
##  Length:1099       
##  Class :character  
##  Mode  :character  
##                    
##                    
##                    
## 
str(compu)
## 'data.frame':    1099 obs. of  11 variables:
##  $ Departamento                : Factor w/ 64 levels ""," Buenaventura",..: 12 12 12 12 15 15 15 15 15 16 ...
##  $ Municipio                   : chr  "Medellin" "Medellin" "Remedios" "Vig\xeda del Fuerte" ...
##  $ Agencia_Organizacion        : chr  "OIM" "OIM" "OIM" "OIM" ...
##  $ Institucion_donde_se_entrega: chr  "Total Albergue" "Total Comunidad" "Total Comunidad" "Total Comunidad" ...
##  $ Nombre_institucion          : chr  "" "" "" "" ...
##  $ Insumo                      : chr  "" "" "" "" ...
##  $ Unidad_de_medidad           : chr  "" "" "" "" ...
##  $ Cantidad_personas           : num  1000 500 200 200 2000 150 1100 500 1000 1400 ...
##  $ Disponible                  : chr  "No" "No" "No" "No" ...
##  $ Entregado                   : chr  "Si" "Si" "Si" "Si" ...
##  $ Fecha_de_entrega            : chr  "Abril" "Abril" "Abril" "Abril" ...
class(compu$Departamento)
## [1] "factor"
class(compu$Municipio)
## [1] "character"
class(compu$Agencia_Organizacion)
## [1] "character"
class(compu$Institucion_donde_se_entrega)
## [1] "character"
summary(compu)
##              Departamento  Municipio         Agencia_Organizacion
##  Norte de Santander:132   Length:1099        Length:1099         
##  Nacional          :127   Class :character   Class :character    
##  La Guajira        : 85   Mode  :character   Mode  :character    
##                    : 70                                          
##  Nari\xf1o         : 66                                          
##  Amazonas          : 56                                          
##  (Other)           :563                                          
##  Institucion_donde_se_entrega Nombre_institucion    Insumo         
##  Length:1099                  Length:1099        Length:1099       
##  Class :character             Class :character   Class :character  
##  Mode  :character             Mode  :character   Mode  :character  
##                                                                    
##                                                                    
##                                                                    
##                                                                    
##  Unidad_de_medidad  Cantidad_personas    Disponible         Entregado        
##  Length:1099        Min.   :      1.0   Length:1099        Length:1099       
##  Class :character   1st Qu.:      6.8   Class :character   Class :character  
##  Mode  :character   Median :    100.0   Mode  :character   Mode  :character  
##                     Mean   :   1888.7                                        
##                     3rd Qu.:    350.0                                        
##                     Max.   :1250000.0                                        
##                     NA's   :59                                               
##  Fecha_de_entrega  
##  Length:1099       
##  Class :character  
##  Mode  :character  
##                    
##                    
##                    
## 
compu$Cantidad_personas = as.numeric(compu$Cantidad_personas)
compu$Departamento=as.factor(compu$Departamento)
compu$Municipio=as.factor(compu$Municipio)


compu$Agencia_Organizacion=as.factor(compu$Agencia_Organizacion)
compu$Institucion_donde_se_entrega=as.factor(compu$Institucion_donde_se_entrega)
compu$Entregado=as.factor(compu$Entregado)
compu$Fecha_de_entrega=as.factor(compu$Fecha_de_entrega)
compu$Nombre_institucion=as.factor(compu$Nombre_institucion)
compu$Unidad_de_medidad=as.factor(compu$Unidad_de_medidad)
summary(compu)
##              Departamento       Municipio     Agencia_Organizacion
##  Norte de Santander:132              :215   OIM         :402      
##  Nacional          :127   Nacional   :127   ACNUR       :218      
##  La Guajira        : 85   (en blanco): 66   OPS         :159      
##                    : 70   C\xfacuta  : 27   UNFPA       :100      
##  Nari\xf1o         : 66   Leticia    : 24   UNICEF      : 60      
##  Amazonas          : 56   Arauquita  : 23   World Vision: 36      
##  (Other)           :563   (Other)    :617   (Other)     :124      
##       Institucion_donde_se_entrega               Nombre_institucion
##                     :399                                  :525     
##  (en blanco)        :159           (en blanco)            :159     
##  Hospital           : 71           Ministerio de Salud    : 71     
##  Ministerio de Salud: 71           Fuerza Aerea Colombiana: 35     
##  Total Hospital     : 41           Comunidad              : 21     
##  Comunidad          : 39           INS                    : 21     
##  (Other)            :319           (Other)                :267     
##     Insumo          Unidad_de_medidad Cantidad_personas    Disponible       
##  Length:1099                :513      Min.   :      1.0   Length:1099       
##  Class :character   unidades:435      1st Qu.:      6.8   Class :character  
##  Mode  :character   galones : 60      Median :    100.0   Mode  :character  
##                     cajas   : 27      Mean   :   1888.7                     
##                     paquetes: 22      3rd Qu.:    350.0                     
##                     kit     : 10      Max.   :1250000.0                     
##                     (Other) : 32      NA's   :59                            
##      Entregado   Fecha_de_entrega
##           :  3   Abril  :445     
##  No       :262   Mayo   :244     
##  Pendiente:  6   Junio  :221     
##  si       : 65   Abril  :106     
##  Si       :437          : 62     
##  SI       :324   Febrero: 13     
##  SI       :  2   (Other):  8
#install.packages(c("credentials", "zip", "desc", "gert", "gitcreds", "pkgbuild", "rprojroot", "whoami"))
#install.packages("rhub")
#library(rhub)
#validate_email(feodora.warmuth@gmx.de)
#check(path = "Pfad/zum/Deinem/Paket")
#?rhubv2
#rhub::check()