R/world_bank_movie.R

# =========================== world_bank_movie ===========================

#' World Bank Development Indicators Movie
#'
#' Explores graphically relationships between four annual World Development
#' Indicators provided in the World Bank's database for the countries of the
#' world, 1960-2014.  Animation is used to visualise how these variables and
#' their inter-relationships vary over time.
#'
#' @details
#' The example code in \strong{Examples} below creates a scatter
#' plot of data on the variables
#' given by the first two arguments of the function, i.e.
#' \code{log(gdp_per_capita)} and \code{log(co2_per_capita)}.
#' Each pair of values in represented by a circle.  The area of the
#' circle is proportional to the argument \code{size}, i.e.
#' \code{population_size} and the argument \code{col} indicates the
#' approximate value of the fourth variable, i.e. \code{life_expectancy}.
#'
#' The scatter plot can be animated over years and points for an individual
#' country can be highlighted in red by clicking the name of the country.
#'
#' See \code{\link[rpanel]{rp.bubbleplot}} for more information.
#'
#' This type of plot was used to great effect by
#' \href{https://en.wikipedia.org/wiki/Hans_Rosling}{Hans Rosling}.
#' To see Hans explain in simple terms the scientific and political issues
#' surrounding these data see
#' \href{https://www.theguardian.com/global-development/video/2013/may/17/population-climate-change-hans-rosling-video}{this video}
#' @return Nothing is returned, only the animation is produced.
#' @seealso \code{\link{movies}}: general information about the movies.
#' @seealso \code{\link{world_bank}}: description of the World Bank Data.
#' @seealso \code{\link[rpanel]{rp.bubbleplot}}: function in the
#'   \code{\link[rpanel]{rpanel.package}} package used to produce this movie.
#' @examples
#' # Load packages rpanel and tkrplot
#' \dontrun{
#' library(rpanel)
#' library(tkrplot)
#' # [Use install.packages("tkrplot") if necessary]
#'
#' # Produce the movie.  You may ignore the warning message that is produced.
#' # [I think the cause may be that some countries have a lot of missing data.]
#' rp.bubbleplot(log(gdp_per_capita), log(co2_per_capita), 1960:2014,
#'               size = population_size, col = life_expectancy,
#'               interpolate = TRUE, hscale = 1.5, vscale = 1.5)
#' }
#' @name world_bank_movie
NULL
## NULL
paulnorthrop/stat1004 documentation built on Nov. 17, 2019, 3:49 a.m.