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
Weg 1
library(visdat)vis_dat(d)
Weg 2
d_na_only <- d %>%rowwise() %>%mutate(na_n =sum(is.na(cur_data()))) %>%ungroup()
Warning: There was 1 warning in `mutate()`.
ℹ In argument: `na_n = sum(is.na(cur_data()))`.
ℹ In row 1.
Caused by warning:
! `cur_data()` was deprecated in dplyr 1.1.0.
ℹ Please use `pick()` instead.
d_na_only %>%ggplot(aes(x = na_n)) +geom_bar()
Categories:
2023
eda
na
string
Source Code
---exname: filter-na4expoints: 1extype: stringexsolution: NAcategories:- 2023- eda- na- stringdate: '2023-05-14'slug: filter-na4title: filter-na4---# AufgabeLiefern Sie einen visuellen Überblick über fehlende Werte im Datensatz `penguins`! </br></br></br></br></br></br></br></br></br></br># Lösung## Setup```{r}library(tidyverse)d_path <-"https://vincentarelbundock.github.io/Rdatasets/csv/palmerpenguins/penguins.csv"d <-read_csv(d_path)nrow(d)```## Weg 1```{r}library(visdat)vis_dat(d)```## Weg 2```{r}d_na_only <- d %>%rowwise() %>%mutate(na_n =sum(is.na(cur_data()))) %>%ungroup()d_na_only %>%ggplot(aes(x = na_n)) +geom_bar()```---Categories: - 2023- eda- na- string