README.md

ccplot

The goal of ccplot is to provide out-of-the-box data visualization tools to analyze and understand worldwide greenhouse gas emissions.

Installation

You can install the development version of ccplot from GitHub with:

# install.packages("devtools")
devtools::install_github("omunizb/climate-change")

Usage

Currently, ccplot has four plotting functions. The following examples use a Data on CO2 and Greenhouse Gas Emissions by Our World in Data dataset by Hannah Ritchie, Max Roser, Edouard Mathieu and Bobbie Macdonald:

Greenhouse_Gas_Emissions <- 
  read.csv("https://raw.githubusercontent.com/owid/co2-data/master/owid-co2-data.csv")
library(ccplot)

plot_emissions(Greenhouse_Gas_Emissions, c("USA", "CHN", "GBR", "RUS"), 
               "Emissions of historical global powers")

library(ccplot)

decade_increase(Greenhouse_Gas_Emissions, c("1990-1999", "1980-1989"), 
                c("USA", "GBR"))
#> # A tibble: 2 x 2
#>   iso_code average
#>   <chr>      <dbl>
#> 1 GBR         661.
#> 2 USA        5597.

library(ccplot)

lproj(df = Greenhouse_Gas_Emissions, region = "USA")
#> Warning in mean.default(proj[, i][[1]], na.rm = TRUE): argument is not numeric
#> or logical: returning NA

#> Warning in mean.default(proj[, i][[1]], na.rm = TRUE): argument is not numeric
#> or logical: returning NA

library(ccplot)

data(futdata)

emissions_pred(Greenhouse_Gas_Emissions, "USA", futdata)
#> Warning in mean.default(proj[, i][[1]], na.rm = TRUE): argument is not numeric
#> or logical: returning NA

#> Warning in mean.default(proj[, i][[1]], na.rm = TRUE): argument is not numeric
#> or logical: returning NA

As you can see in this example, ccplot also includes the dataset futdatawith projections of US population and GDP until 2030.



omunizb/climate-change documentation built on Jan. 3, 2022, 12:15 a.m.