From ed55ed38422b43d2ed0cb5fff2e15ecfbaf1e4dc Mon Sep 17 00:00:00 2001 From: Tom Godfrey <47148509+thomasggodfrey@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:16:14 +0100 Subject: [PATCH] Refactor code that recodes status in lung dataset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update code to replace dplyr::recode() which is now superseded by dplyr::replace_values() (dplyr ≥ 1.2.0). --- survival-analysis-in-r.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/survival-analysis-in-r.qmd b/survival-analysis-in-r.qmd index 9f931f4..0bd4271 100644 --- a/survival-analysis-in-r.qmd +++ b/survival-analysis-in-r.qmd @@ -185,7 +185,7 @@ Throughout this section, we will use the `lung` dataset from the {survival} pack lung <- lung |> mutate( - status = recode(status, `1` = 0, `2` = 1) + status = replace_values(status, 1 ~ 0, 2 ~ 1) ) ```