Filtern Sie alle Zeilen mit fehlende Werte im Datensatz penguins!
153.0.1 Setup
library(tidyverse)
d_path <- "https://vincentarelbundock.github.io/Rdatasets/csv/palmerpenguins/penguins.csv"
d <- read_csv(d_path)
## Rows: 344 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): species, island, sex
## dbl (6): rownames, bill_length_mm, bill_depth_mm, flipper_length_mm, body_ma...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
nrow(d)
## [1] 344
153.0.2 Weg 1
d %>%
filter(!complete.cases(.)) %>%
nrow()
## [1] 11
153.0.3 Weg 2
d %>%
filter(if_any(everything(), ~ is.na(.))) %>%
nrow()
## [1] 11
Aufgabenname: filter-na2
Categories:
- 2023
- eda
- na
- string