R Markdown

## Time difference of 0.2639539 secs
## loop function time:  0.268939
## map function time:  0.03615785

Other map functions

## $years
## [1] 1990
## 
## $a
## [1] 4.920349
## 
## $b
## [1] 201.0297
##           average logical
## years 1990.000000    TRUE
## a        4.920349   FALSE
## b      201.029747    TRUE

Maps with pipe operators

## $LakeErieS
## [1] 2.70805
## 
## $LakeErieN
## [1] 6.912743
## 
## $LakeErieW
## [1] 9.21044
## 
## $LakeErieE
## [1] 3.218876
## [[1]]
## 
## Call:
## lm(formula = a ~ b, data = .)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.3707 -1.4360  0.1539  1.5372  8.0580 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  4.60056    2.77597   1.657    0.099 .
## b            0.00242    0.01378   0.176    0.861  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.711 on 198 degrees of freedom
## Multiple R-squared:  0.0001557,  Adjusted R-squared:  -0.004894 
## F-statistic: 0.03084 on 1 and 198 DF,  p-value: 0.8608
## 
## 
## [[2]]
## 
## Call:
## lm(formula = a ~ b, data = .)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.5307 -1.6329 -0.0207  1.5045  7.2908 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  6.084166   2.244388   2.711   0.0073 **
## b           -0.005489   0.011307  -0.485   0.6279   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.388 on 198 degrees of freedom
## Multiple R-squared:  0.001189,   Adjusted R-squared:  -0.003855 
## F-statistic: 0.2357 on 1 and 198 DF,  p-value: 0.6279
## 
## 
## [[3]]
## 
## Call:
## lm(formula = a ~ b, data = .)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -6.3305 -1.5904  0.1304  1.7518  8.9316 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept) 3.947289   2.191565   1.801   0.0732 .
## b           0.004746   0.010934   0.434   0.6647  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.569 on 198 degrees of freedom
## Multiple R-squared:  0.0009506,  Adjusted R-squared:  -0.004095 
## F-statistic: 0.1884 on 1 and 198 DF,  p-value: 0.6647
## $`A New Hope`
## [1] "George Lucas"
## 
## $`Attack of the Clones`
## [1] "George Lucas"
## 
## $`The Phantom Menace`
## [1] "George Lucas"
## 
## $`Revenge of the Sith`
## [1] "George Lucas"
## 
## $`Return of the Jedi`
## [1] "Richard Marquand"
## 
## $`The Empire Strikes Back`
## [1] "Irvin Kershner"
## 
## $`The Force Awakens`
## [1] "J. J. Abrams"
##              A New Hope    Attack of the Clones      The Phantom Menace 
##          "George Lucas"          "George Lucas"          "George Lucas" 
##     Revenge of the Sith      Return of the Jedi The Empire Strikes Back 
##          "George Lucas"      "Richard Marquand"        "Irvin Kershner" 
##       The Force Awakens 
##          "J. J. Abrams"
## $`A New Hope`
## [1] TRUE
## 
## $`Attack of the Clones`
## [1] TRUE
## 
## $`The Phantom Menace`
## [1] TRUE
## 
## $`Revenge of the Sith`
## [1] TRUE
## 
## $`Return of the Jedi`
## [1] FALSE
## 
## $`The Empire Strikes Back`
## [1] FALSE
## 
## $`The Force Awakens`
## [1] FALSE
##              A New Hope    Attack of the Clones      The Phantom Menace 
##                    TRUE                    TRUE                    TRUE 
##     Revenge of the Sith      Return of the Jedi The Empire Strikes Back 
##                    TRUE                   FALSE                   FALSE 
##       The Force Awakens 
##                   FALSE

Safely and possibly

## Warning in .f(...): Se han producido NaNs
## [[1]]
## [[1]]$result
## [1] NaN
## 
## [[1]]$error
## NULL
## 
## 
## [[2]]
## [[2]]$result
## [1] 0
## 
## [[2]]$error
## NULL
## 
## 
## [[3]]
## [[3]]$result
## [1] 2.302585
## 
## [[3]]$error
## NULL
## 
## 
## [[4]]
## [[4]]$result
## [1] -Inf
## 
## [[4]]$error
## NULL
## NULL
## NULL
## Warning in log(x): Se han producido NaNs

walk

## final example

## Warning: NAs introducidos por coerción

## Warning: NAs introducidos por coerción
## Warning: Ignoring unknown parameters: binwidth, bins, pad
## Warning: Removed 6 rows containing non-finite values (stat_count).