README.md

graph

The graph package was created to complete the Assignment B-2, for the STAT545b 2021 course.

Overview

graph is a package based on ggplot2 developed to facilitate the creation of histograms to explore the distribution of variables. The function histogram() displays the distribution of a single numeric variable through a histogram.

Installation

graph is not yet on CRAN, but you can install the package from GitHub using the following code:

devtools::install_github("cataralina/graph")

Usage

The package have one function that displays the distribution of a single numeric variable through a histogram:

You start with histogram(), and then supply a dataset and the numeric variable to plot. Information about the xlab title, the number of bins and what to do with the NA is optional, but you can specify it using:

Example

library(graph)
library(gapminder)
histogram(gapminder, lifeExp)

histogram(gapminder, lifeExp, xlab = "Life Expectancy")

histogram(gapminder, gdpPercap, xlab = "GDP per capita", bins = 20)



cataralina/graph documentation built on Dec. 19, 2021, 1:55 p.m.