diff --git a/strings.qmd b/strings.qmd index 7ac48e7..01b089f 100644 --- a/strings.qmd +++ b/strings.qmd @@ -3,6 +3,7 @@ ```{r} #| results: "asis" #| echo: false + source("_common.R") status("complete") ``` @@ -166,7 +167,7 @@ str_c("Hello ", c("John", "Susan")) `str_c()` is very similar to the base `paste0()`, but is designed to be used with `mutate()` by obeying the usual tidyverse rules for recycling and propagating missing values: ```{r} -df <- tibble(name = c("Flora", "David", "Terra")) +df <- tibble(name = c("Flora", "David", "Terra", NA)) df |> mutate(greeting = str_c("Hi ", name, "!")) ```