From ecaceec8e8a412ebeb18dab12b0e6499a3035d73 Mon Sep 17 00:00:00 2001 From: carpenter Date: Tue, 24 Dec 2024 15:38:12 +0900 Subject: [PATCH] Use drop_na() instead of remove_missing() --- episodes/basic-targets.Rmd | 2 +- episodes/files/plans/plan_1.R | 2 +- episodes/files/tar_functions/clean_penguin_data.R | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/episodes/basic-targets.Rmd b/episodes/basic-targets.Rmd index 2ce3d0c8..5c1f4e2b 100644 --- a/episodes/basic-targets.Rmd +++ b/episodes/basic-targets.Rmd @@ -185,7 +185,7 @@ penguins_data <- penguins_data_raw |> bill_depth_mm = `Culmen Depth (mm)` ) |> # Delete rows with missing data - remove_missing(na.rm = TRUE) + drop_na() penguins_data ``` diff --git a/episodes/files/plans/plan_1.R b/episodes/files/plans/plan_1.R index 7c5575e3..2da0f1a4 100644 --- a/episodes/files/plans/plan_1.R +++ b/episodes/files/plans/plan_1.R @@ -10,7 +10,7 @@ clean_penguin_data <- function(penguins_data_raw) { bill_length_mm = `Culmen Length (mm)`, bill_depth_mm = `Culmen Depth (mm)` ) |> - remove_missing(na.rm = TRUE) + drop_na() } list( diff --git a/episodes/files/tar_functions/clean_penguin_data.R b/episodes/files/tar_functions/clean_penguin_data.R index ab7feaf4..a0b6994e 100644 --- a/episodes/files/tar_functions/clean_penguin_data.R +++ b/episodes/files/tar_functions/clean_penguin_data.R @@ -5,7 +5,7 @@ clean_penguin_data <- function(penguins_data_raw) { bill_length_mm = `Culmen Length (mm)`, bill_depth_mm = `Culmen Depth (mm)` ) |> - remove_missing(na.rm = TRUE) |> + drop_na() |> # Split "species" apart on spaces, and only keep the first word separate(species, into = "species", extra = "drop") }