Favour datasets in a database
Arguments
- database
A many database
- dataset
The name of one, or more, datasets within the database to be favoured over others.
Details
The dataset declared becomes the reference for the first non NA value. If more than one dataset is declared, please list datasets in increasing order of importance (.i.e. last dataset should be favoured over previous).
Examples
favour(emperors, "UNRV")
#> $UNRV
#> # A tibble: 99 × 7
#> ID Beg End Birth Death FullName Dynasty
#> <chr> <mdate> <mdate> <chr> <chr> <chr> <chr>
#> 1 Augustus -0027 -0014 63 BC 14 Gaius Julius Caesar Oct… Julio-…
#> 2 Tiberius -0014 0037 42 BC 37 Tiberius Claudius Nero … Julio-…
#> 3 Gaius (Caligula) 0037 0041 12 14 Gaius Caesar Germanicus… Julio-…
#> 4 Claudius 0041 0054 10 BC 41 Tiberius Claudius Nero … Julio-…
#> 5 Nero 0054 0068 37 68 Claudius Nero Caesar (b… Julio-…
#> 6 Galba 0068 0069 3 BC 69 Servius Sulpicius Galba… Year o…
#> 7 Otho 0069 0069 32 69 Marcus Salvius Otho / I… Year o…
#> 8 Vitellius 0069 0069 15 69 Aulus Vitellius / Aulus… Year o…
#> 9 Vespasian 0069 0079 9 79 Titus Flavius Vespasian… Year o…
#> 10 Titus 0079 0081 39 79 Titus Flavius Vespasian… Flavian
#> # … with 89 more rows
#>
#> $wikipedia
#> # A tibble: 68 × 15
#> ID Beg End FullN…¹ Birth Death CityB…² Provi…³ Rise Cause Killer
#> <chr> <mdat> <mda> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Augustus -0026… 0014… IMPERA… 0062… 0014… Rome Italia Birt… Assa… Wife
#> 2 Tiberius 0014-… 0037… TIBERI… 0041… 0037… Rome Italia Birt… Assa… Other…
#> 3 Caligula 0037-… 0041… GAIVS … 0012… 0041… Antitum Italia Birt… Assa… Senate
#> 4 Claudius 0041-… 0054… TIBERI… 0009… 0054… Lugdun… Gallia… Birt… Assa… Wife
#> 5 Nero 0054-… 0068… NERO C… 0037… 0068… Antitum Italia Birt… Suic… Senate
#> 6 Galba 0068-… 0069… SERVIV… 0002… 0069… Terrac… Italia Seiz… Assa… Other…
#> 7 Otho 0069-… 0069… MARCVS… 0032… 0069… Terent… Italia Appo… Suic… Other…
#> 8 Vitellius 0069-… 0069… AVLVS … 0015… 0069… Rome Italia Seiz… Assa… Other…
#> 9 Vespasian 0069-… 0079… TITVS … 0009… 0079… Falacr… Italia Seiz… Natu… Disea…
#> 10 Titus 0079-… 0081… TITVS … 0039… 0081… Rome Italia Birt… Natu… Disea…
#> # … with 58 more rows, 4 more variables: Dynasty <chr>, Era <chr>, Notes <chr>,
#> # Verif <chr>, and abbreviated variable names ¹FullName, ²CityBirth,
#> # ³ProvinceBirth
#>
#> $britannica
#> # A tibble: 87 × 3
#> ID Beg End
#> <chr> <mdate> <mdate>
#> 1 Augustus -0031 0014
#> 2 Tiberius 0014 0037
#> 3 Caligula 0037 0041
#> 4 Claudius 0041 0054
#> 5 Nero 0054 0068
#> 6 Galba 0068 0069
#> 7 Otho 0069-01 0069-04
#> 8 Aulus Vitellius 0069-07 0069-12
#> 9 Vespasian 0069 0079
#> 10 Titus 0079 0081
#> # … with 77 more rows
#>
favour(emperors, c("wikipedia", "UNRV", "britannica"))
#> $britannica
#> # A tibble: 87 × 3
#> ID Beg End
#> <chr> <mdate> <mdate>
#> 1 Augustus -0031 0014
#> 2 Tiberius 0014 0037
#> 3 Caligula 0037 0041
#> 4 Claudius 0041 0054
#> 5 Nero 0054 0068
#> 6 Galba 0068 0069
#> 7 Otho 0069-01 0069-04
#> 8 Aulus Vitellius 0069-07 0069-12
#> 9 Vespasian 0069 0079
#> 10 Titus 0079 0081
#> # … with 77 more rows
#>
#> $UNRV
#> # A tibble: 99 × 7
#> ID Beg End Birth Death FullName Dynasty
#> <chr> <mdate> <mdate> <chr> <chr> <chr> <chr>
#> 1 Augustus -0027 -0014 63 BC 14 Gaius Julius Caesar Oct… Julio-…
#> 2 Tiberius -0014 0037 42 BC 37 Tiberius Claudius Nero … Julio-…
#> 3 Gaius (Caligula) 0037 0041 12 14 Gaius Caesar Germanicus… Julio-…
#> 4 Claudius 0041 0054 10 BC 41 Tiberius Claudius Nero … Julio-…
#> 5 Nero 0054 0068 37 68 Claudius Nero Caesar (b… Julio-…
#> 6 Galba 0068 0069 3 BC 69 Servius Sulpicius Galba… Year o…
#> 7 Otho 0069 0069 32 69 Marcus Salvius Otho / I… Year o…
#> 8 Vitellius 0069 0069 15 69 Aulus Vitellius / Aulus… Year o…
#> 9 Vespasian 0069 0079 9 79 Titus Flavius Vespasian… Year o…
#> 10 Titus 0079 0081 39 79 Titus Flavius Vespasian… Flavian
#> # … with 89 more rows
#>
#> $wikipedia
#> # A tibble: 68 × 15
#> ID Beg End FullN…¹ Birth Death CityB…² Provi…³ Rise Cause Killer
#> <chr> <mdat> <mda> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Augustus -0026… 0014… IMPERA… 0062… 0014… Rome Italia Birt… Assa… Wife
#> 2 Tiberius 0014-… 0037… TIBERI… 0041… 0037… Rome Italia Birt… Assa… Other…
#> 3 Caligula 0037-… 0041… GAIVS … 0012… 0041… Antitum Italia Birt… Assa… Senate
#> 4 Claudius 0041-… 0054… TIBERI… 0009… 0054… Lugdun… Gallia… Birt… Assa… Wife
#> 5 Nero 0054-… 0068… NERO C… 0037… 0068… Antitum Italia Birt… Suic… Senate
#> 6 Galba 0068-… 0069… SERVIV… 0002… 0069… Terrac… Italia Seiz… Assa… Other…
#> 7 Otho 0069-… 0069… MARCVS… 0032… 0069… Terent… Italia Appo… Suic… Other…
#> 8 Vitellius 0069-… 0069… AVLVS … 0015… 0069… Rome Italia Seiz… Assa… Other…
#> 9 Vespasian 0069-… 0079… TITVS … 0009… 0079… Falacr… Italia Seiz… Natu… Disea…
#> 10 Titus 0079-… 0081… TITVS … 0039… 0081… Rome Italia Birt… Natu… Disea…
#> # … with 58 more rows, 4 more variables: Dynasty <chr>, Era <chr>, Notes <chr>,
#> # Verif <chr>, and abbreviated variable names ¹FullName, ²CityBirth,
#> # ³ProvinceBirth
#>