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

Diagrama de barra

-Represents variables categorical y de frecencia.

df<-data.frame(Estudiante=c("Linki","jose","angela"),
               Promedio=c(3,3.5,4))


knitr::kable(df)
Estudiante Promedio
Linki 3.0
jose 3.5
angela 4.0
library(ggplot2)
ggplot(data=df, aes(x=Estudiante, y=Promedio))+
  geom_bar(stat="identity")

#Diagrama de barras Empresas Representa variables categoricas y de frecuencia Ejer \(x\) reprsenta las empresas _Eje \(y\) representa los asalariados

df<-data.frame(Empresa = 
                   c("Disney World", 
                      "Florida Hospital", 
                      "Publix Supermarkets Inc",
                      "Walmart Stores Ind",
                      "Univaersal Orlando"),Asalariados = 
                   c(51600,
                     19283,
                     14995,
                     14995,
                     12000))
knitr::kable(df)
Empresa Asalariados
Disney World 51600
Florida Hospital 19283
Publix Supermarkets Inc 14995
Walmart Stores Ind 14995
Univaersal Orlando 12000
library(ggplot2)
ggplot(data=df, aes(x=Empresa, y=Asalariados))+geom_bar(stat="identity")

#Diagrama de barras agrupado

df <- data.frame(Especialidad = c(rep("Finanzas", 2), 
                                  rep("Marketing", 2), 
                                  rep("Contabilidad", 2)),
                 Año = rep(c(2000, 2005), 3),
                 Matriculados = c(160, 250,
                                  140, 200,
                                  100, 150))
knitr::kable(df)
Especialidad Año Matriculados
Finanzas 2000 160
Finanzas 2005 250
Marketing 2000 140
Marketing 2005 200
Contabilidad 2000 100
Contabilidad 2005 150
ggplot(df, aes(fill = Especialidad, y = Matriculados, x = Año)) +
  geom_bar(position="dodge", stat="identity")

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