knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

histogramplot

This package is used for data visualization, especially when there is a group variable in a dataset. It contains the function histogram_plot that can make histogram plots for a certain variable in different groups or levels in the dataset seperately.

Installation

You can install the released version of histogramplot from CRAN with:

install.packages("histogramplot")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("graceyin06/545B-package")

Required packages for applying the function "histogram_plot" in histogramplot package

Example

There are two examples showing how to use this package to make seperate histogram plots.

#load the required packages
suppressMessages(library(dplyr))
suppressMessages(library(magrittr))
suppressMessages(library(datateachr))
suppressMessages(library(tidyverse))

Example 1

Make the histogram plots for radius_mean in two diagnosis groups.

#load the dataset
library(gapminder)
#load the histogramplot package
library(histogramplot)
## basic example code
# make two histogram plots for radius_mean in two diagnosis groups.
histogram_plot(cancer_sample,diagnosis,radius_mean,"radius_mean")

Example 2

Make the histogram plots for lifeExp in five continents in gapminder datset .

### make the histogram plots for lifeExp in five continents.
histogram_plot(gapminder,continent,lifeExp,"lifeExp")


graceyin06/545B-package documentation built on Dec. 20, 2021, 12:49 p.m.