removed unhcr_popstats_2017 dataset because of annoying note
This commit is contained in:
parent
4f4142211b
commit
dddd472c1f
17
R/data.R
17
R/data.R
|
@ -1,20 +1,3 @@
|
|||
#' UNHCR data for 2017
|
||||
#'
|
||||
#' The dataset contains data about UNHCR's populations of concern for the year 2017.
|
||||
#'
|
||||
#' @format A data frame with 11237 observations and the following 6 variables:
|
||||
#' \describe{
|
||||
#' \item{\code{country_origin}}{Country of origin of population}
|
||||
#' \item{\code{country_residence}}{Country / territory of asylum/residence of population}
|
||||
#' \item{\code{population_type}}{Populations of concern : Refugees, Asylum-seekers, Internally displaced persons (IDPs), Returned refugees,
|
||||
#' Returned IDPs, Stateless persons, Others of concern.}
|
||||
#' \item{\code{value}}{Number of people concerned}
|
||||
#' \item{\code{continent_residence}}{Continent of origin of population}
|
||||
#' \item{\code{continent_origin}}{Continent of residence of population}
|
||||
#' }
|
||||
#' @source UNHCR (The UN Refugee Agency) (\url{https://www.unhcr.org/})
|
||||
"unhcr_popstats_2017"
|
||||
|
||||
|
||||
#' UNHCR data by continent of origin
|
||||
#'
|
||||
|
|
Binary file not shown.
|
@ -2,34 +2,38 @@
|
|||
library(apexcharter)
|
||||
|
||||
# On a column chart
|
||||
apex(
|
||||
data = table(unhcr_popstats_2017$continent_residence),
|
||||
aes(Var1, Freq),
|
||||
"column"
|
||||
) %>%
|
||||
add_hline(value = 2100)
|
||||
unhcr_ts %>%
|
||||
subset(year == 2017 & population_type == "Asylum-seekers") %>%
|
||||
apex(
|
||||
aes(continent_origin, n),
|
||||
"column"
|
||||
) %>%
|
||||
add_hline(value = 5e5)
|
||||
|
||||
|
||||
# On a scatter chart
|
||||
apex(
|
||||
data = iris,
|
||||
aes(Sepal.Length, Sepal.Width),
|
||||
data = cars,
|
||||
aes(speed, dist),
|
||||
"scatter"
|
||||
) %>%
|
||||
add_hline(value = mean(iris$Sepal.Width)) %>%
|
||||
add_vline(value = mean(iris$Sepal.Length))
|
||||
add_hline(value = mean(cars$dist)) %>%
|
||||
add_vline(value = mean(cars$speed))
|
||||
|
||||
# With labels
|
||||
apex(
|
||||
data = iris,
|
||||
aes(Sepal.Length, Sepal.Width),
|
||||
data = cars,
|
||||
aes(speed, dist),
|
||||
"scatter"
|
||||
) %>%
|
||||
add_hline(
|
||||
value = mean(iris$Sepal.Width),
|
||||
label = "Mean of Sepal.Width"
|
||||
value = mean(cars$dist),
|
||||
label = "Mean of dist"
|
||||
) %>%
|
||||
add_vline(
|
||||
value = mean(iris$Sepal.Length),
|
||||
label = "Mean of Sepal.Length"
|
||||
value = mean(cars$speed),
|
||||
label = label(
|
||||
text = "Mean of speed",
|
||||
borderColor = "red"
|
||||
)
|
||||
)
|
||||
|
|
|
@ -38,35 +38,39 @@ Add horizontal or vertical line
|
|||
library(apexcharter)
|
||||
|
||||
# On a column chart
|
||||
apex(
|
||||
data = table(unhcr_popstats_2017$continent_residence),
|
||||
aes(Var1, Freq),
|
||||
"column"
|
||||
) \%>\%
|
||||
add_hline(value = 2100)
|
||||
unhcr_ts \%>\%
|
||||
subset(year == 2017 & population_type == "Asylum-seekers") \%>\%
|
||||
apex(
|
||||
aes(continent_origin, n),
|
||||
"column"
|
||||
) \%>\%
|
||||
add_hline(value = 5e5)
|
||||
|
||||
|
||||
# On a scatter chart
|
||||
apex(
|
||||
data = iris,
|
||||
aes(Sepal.Length, Sepal.Width),
|
||||
data = cars,
|
||||
aes(speed, dist),
|
||||
"scatter"
|
||||
) \%>\%
|
||||
add_hline(value = mean(iris$Sepal.Width)) \%>\%
|
||||
add_vline(value = mean(iris$Sepal.Length))
|
||||
add_hline(value = mean(cars$dist)) \%>\%
|
||||
add_vline(value = mean(cars$speed))
|
||||
|
||||
# With labels
|
||||
apex(
|
||||
data = iris,
|
||||
aes(Sepal.Length, Sepal.Width),
|
||||
data = cars,
|
||||
aes(speed, dist),
|
||||
"scatter"
|
||||
) \%>\%
|
||||
add_hline(
|
||||
value = mean(iris$Sepal.Width),
|
||||
label = "Mean of Sepal.Width"
|
||||
value = mean(cars$dist),
|
||||
label = "Mean of dist"
|
||||
) \%>\%
|
||||
add_vline(
|
||||
value = mean(iris$Sepal.Length),
|
||||
label = "Mean of Sepal.Length"
|
||||
value = mean(cars$speed),
|
||||
label = label(
|
||||
text = "Mean of speed",
|
||||
borderColor = "red"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{unhcr_popstats_2017}
|
||||
\alias{unhcr_popstats_2017}
|
||||
\title{UNHCR data for 2017}
|
||||
\format{
|
||||
A data frame with 11237 observations and the following 6 variables:
|
||||
\describe{
|
||||
\item{\code{country_origin}}{Country of origin of population}
|
||||
\item{\code{country_residence}}{Country / territory of asylum/residence of population}
|
||||
\item{\code{population_type}}{Populations of concern : Refugees, Asylum-seekers, Internally displaced persons (IDPs), Returned refugees,
|
||||
Returned IDPs, Stateless persons, Others of concern.}
|
||||
\item{\code{value}}{Number of people concerned}
|
||||
\item{\code{continent_residence}}{Continent of origin of population}
|
||||
\item{\code{continent_origin}}{Continent of residence of population}
|
||||
}
|
||||
}
|
||||
\source{
|
||||
UNHCR (The UN Refugee Agency) (\url{https://www.unhcr.org/})
|
||||
}
|
||||
\usage{
|
||||
unhcr_popstats_2017
|
||||
}
|
||||
\description{
|
||||
The dataset contains data about UNHCR's populations of concern for the year 2017.
|
||||
}
|
||||
\keyword{datasets}
|
Loading…
Reference in New Issue