Skip to content

Commit d732f38

Browse files
committed
Few tweaks to code and deck
1 parent 1c8b200 commit d732f38

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

59-comunicando-con-R/5-r-fabricantes.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ load("datos/millas.rda")
55

66
fabricantes <- unique(millas$fabricante)
77

8+
# map() para correr la misma funcion por cada valor
9+
map(fabricantes, ~print(.x))
10+
11+
# render() para crear un nuevo reporte
12+
render("4-rmarkdown-fabricante.Rmd", params = list(fabricante = "audi"))
13+
14+
# map() y render() son una poderosa combinacion
815
map(fabricantes, ~
916
render(
1017
"4-rmarkdown-fabricante.Rmd",

59-comunicando-con-R/9-plumber-api/plumber.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ library(plumber)
55
#* @get /millas
66
#* @param cilindros
77
#* @param clase
8+
9+
load("datos/millas.rda")
10+
load("modelo.rds")
11+
812
function(cilindros, clase) {
913
cilindros <- as.integer(cilindros)
1014
predict(modelo, data.frame(clase = clase, cilindros = cilindros))
13 KB
Binary file not shown.

59-comunicando-con-R/modelo.rds

-98 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)