From 661b0a5339d3b8a1d568740e0df7a24714218aa9 Mon Sep 17 00:00:00 2001 From: mine-cetinkaya-rundel Date: Fri, 24 Feb 2023 00:18:33 -0500 Subject: [PATCH] Adding back an NA, closes #1273 --- strings.qmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, "!")) ```