R Markdown

Encabezado 1

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.

Lista desordenada

  • autos 1
  • motos 2
    • 200cc 2a
    • 300cc 2b

lista ordenada

  1. Item 1
  2. Item 2
  3. Item 3

Encabezado 4

read.csv() se usa para leer arhivos externos

  • argumento1
  • argumento2

Conclusión:

https://www.indec.gob.ar/

Cualquier duda consulte los informes en la pagina del indec del organismo.

Tablas

html

Pais Población columna
Argentina 40 millones dolor
Italia 60 millones de cabeza
Ecuaciones

\(equation\)

\[ x^n + y^n = z^n \]

\[ \sum_{n=0}^{100} x^{_{n}} \] https://www.codecogs.com/latex/eqneditor.php?lang=es-es

Header con HTML

Otros




Supraíndice2

Texto tachado

Texto tachado

imagenes

optional caption text

optional caption text

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:

Insertr codigo R

load("Notas_Practico2.RData")

Resumen

#install.packages("rpivotTable")
library(rpivotTable)
rpivotTable(lengua[,c("instituto", "domicilio","famsize",
                      "id","mjob", "fjob",
                      "g1", "g2", "g3", "notaFinal")],
            aggregatorName = "Average",
            cols= "instituto",
            rows = "domicilio",
            vals = "notaFinal",
            rendererName = "Heatmap")

Graficos

Tabulamos

library(reshape2)
nuevaMatriz <- acast(data = lengua, 
                     formula = instituto ~ edad, 
                     value.var = "absences", 
                     fun.aggregate = mean)
nuevaMatriz
##          15       16       17       18       19    20   21  22
## GP 2.837209 3.526786 4.923077 5.095238 5.058824  5.25 10.5  12
## MS 3.192308 1.984615 2.500000 2.824561 3.200000 10.00  NaN NaN
par(mar=c(2, 4, 2, 2))  

y <- barplot(nuevaMatriz, col = paleta, 
             xaxt = "n", horiz = TRUE, 
             space=1, las=1, border = NA, 
             family="PT Sans")  

box(bty="o")    
    
legend("topright", as.vector(row.names(nuevaMatriz)), 
       cex = 1,  fill = paleta, 
       bty = "n",  horiz = FALSE)

Incluímos una tabla

library(knitr)
kable(nuevaMatriz)
15 16 17 18 19 20 21 22
GP 2.837209 3.526786 4.923077 5.095238 5.058823 5.25 10.5 12
MS 3.192308 1.984615 2.500000 2.824561 3.200000 10.00 NaN NaN

Apendice

library(knitr)
kable(nuevaMatriz)

paleta=c(rgb(37,52,148,255, maxColorValue = 255),
         rgb(44,127,184,255, maxColorValue = 255), 
         rgb(65,182,196,255, maxColorValue = 255),
         rgb(127,205,187,255, maxColorValue = 255),
         rgb(199,233,180,255, maxColorValue = 255),
         rgb(255,255,204,255, maxColorValue = 255)) 
         
library(reshape2)
nuevaMatriz <- acast(data = lengua, 
                     formula = instituto ~ edad, 
                     value.var = "absences", 
                     fun.aggregate = mean)
nuevaMatriz        
paleta=c(rgb(37,52,148,255, maxColorValue = 255),
         rgb(44,127,184,255, maxColorValue = 255), 
         rgb(65,182,196,255, maxColorValue = 255),
         rgb(127,205,187,255, maxColorValue = 255),
         rgb(199,233,180,255, maxColorValue = 255),
         rgb(255,255,204,255, maxColorValue = 255)) 

library(reshape2)
nuevaMatriz <- acast(data = lengua, 
                     formula = instituto ~ edad, 
                     value.var = "absences", 
                     fun.aggregate = mean)
nuevaMatriz
par(mar=c(2, 4, 2, 2))  

y <- barplot(nuevaMatriz, col = paleta, 
             xaxt = "n", horiz = TRUE, 
             space=1, las=1, border = NA, 
             family="PT Sans")  

box(bty="o")    
    
legend("topright", as.vector(row.names(nuevaMatriz)), 
       cex = 1,  fill = paleta, 
       bty = "n",  horiz = FALSE)
library(knitr)
kable(nuevaMatriz)