From c5b7811645fdd1a3d11f6d5fb60cb763b08a4b1a Mon Sep 17 00:00:00 2001 From: mine-cetinkaya-rundel Date: Thu, 25 May 2023 23:26:36 -0400 Subject: [PATCH] Fix code formatting --- base-R.qmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base-R.qmd b/base-R.qmd index a3d9a12..8ae1b8f 100644 --- a/base-R.qmd +++ b/base-R.qmd @@ -428,7 +428,7 @@ The final member of the apply family is the titular `apply()`, which works with In particular, watch out for `apply(df, 2, something)`, which is a slow and potentially dangerous way of doing `lapply(df, something)`. This rarely comes up in data science because we usually work with data frames and not matrices. -## For loops +## `for` loops `for` loops are the fundamental building block of iteration that both the apply and map families use under the hood. `for` loops are powerful and general tools that are important to learn as you become a more experienced R programmer. @@ -443,7 +443,7 @@ for (element in vector) { ``` The most straightforward use of `for` loops is to achieve the same effect as `walk()`: call some function with a side-effect on each element of a list. -For example, in @sec-save-database instead of using walk: +For example, in @sec-save-database instead of using `walk()`: ```{r} #| eval: false