table1_path <- "https://raw.githubusercontent.com/sebastiansauer/Lehre/main/data/tidy-table1.csv"
table1 <- read_csv(table1_path)tidydata1
datawrangling
tidy
schoice
Aufgabe
Laden Sie die folgende Tabellen mit folgendem Befehl aus dem Paket tidyverse:
Insgesamt sollten Sie als folgende Tabellen in Ihrem environment verfügbar haben:
- table1
- table2
- table3
- table4
- table5
Welche der Tabellen ist in der Normalform?
Answerlist
- table1
- table2
- table3
- table4
- table5
Lösung
Laden wir noch die übrigen Tabellen
table2_path <- "https://raw.githubusercontent.com/sebastiansauer/Lehre/main/data/tidy-table2.csv"
table2 <- read_csv(table2_path)
table3_path <- "https://raw.githubusercontent.com/sebastiansauer/Lehre/main/data/tidy-table3.csv"
table3 <- read_csv(table3_path)
table4_path <- "https://raw.githubusercontent.com/sebastiansauer/Lehre/main/data/tidy-table4.csv"
table4 <- read_csv(table4_path)
table5_path <- "https://raw.githubusercontent.com/sebastiansauer/Lehre/main/data/tidy-table5.csv"
table5 <- read_csv(table5_path)Betrachten wir alle fünf Tabellen:
table1| country | year | cases | population |
|---|---|---|---|
| Afghanistan | 1999 | 745 | 19987071 |
| Afghanistan | 2000 | 2666 | 20595360 |
| Brazil | 1999 | 37737 | 172006362 |
| Brazil | 2000 | 80488 | 174504898 |
| China | 1999 | 212258 | 1272915272 |
| China | 2000 | 213766 | 1280428583 |
table2| country | year | type | count |
|---|---|---|---|
| Afghanistan | 1999 | cases | 745 |
| Afghanistan | 1999 | population | 19987071 |
| Afghanistan | 2000 | cases | 2666 |
| Afghanistan | 2000 | population | 20595360 |
| Brazil | 1999 | cases | 37737 |
| Brazil | 1999 | population | 172006362 |
| Brazil | 2000 | cases | 80488 |
| Brazil | 2000 | population | 174504898 |
| China | 1999 | cases | 212258 |
| China | 1999 | population | 1272915272 |
| China | 2000 | cases | 213766 |
| China | 2000 | population | 1280428583 |
table3| country | year | rate |
|---|---|---|
| Afghanistan | 1999 | 745/19987071 |
| Afghanistan | 2000 | 2666/20595360 |
| Brazil | 1999 | 37737/172006362 |
| Brazil | 2000 | 80488/174504898 |
| China | 1999 | 212258/1272915272 |
| China | 2000 | 213766/1280428583 |
table4| country | 1999 | 2000 |
|---|---|---|
| Afghanistan | 745 | 2666 |
| Brazil | 37737 | 80488 |
| China | 212258 | 213766 |
table5| country | century | year | rate |
|---|---|---|---|
| Afghanistan | 19 | 99 | 745/19987071 |
| Afghanistan | 20 | 00 | 2666/20595360 |
| Brazil | 19 | 99 | 37737/172006362 |
| Brazil | 20 | 00 | 80488/174504898 |
| China | 19 | 99 | 212258/1272915272 |
| China | 20 | 00 | 213766/1280428583 |
Man sieht, dass nur Tabelle 1 “tidy” ist.
Answerlist
- Wahr
- Falsch
- Falsch
- Falsch
- Falsch
Categories:
- datawrangling
- tidy
- schoice