
<!-- README.md is generated from README.Rmd. Please edit that file -->

# socviz <img src="man/figures/logo.png" align="right" width="120" />

<!-- badges: start -->

[![R build
status](https://github.com/kjhealy/socviz/workflows/R-CMD-check/badge.svg)](https://github.com/kjhealy/socviz/actions)
<!-- badges: end -->

This is an R package of datasets and utility functions to accompany
*[Data Visualization: A Practical
Introduction](https://press.princeton.edu/books/paperback/9780691181622/data-visualization)*
(Princeton University Press, 2026).

<img src="https://socviz.co/assets/cover/dv-cover-2e.png" width = "75%"/>

## What’s in this Package

The `socviz` package contains about thirty datasets and a number of
utility and convenience functions used in *[Data Visualization: A
Practical Introduction](https://socviz.co)* and of use to people
producing data visualizations with R and ggplot.

## Installation

To install the package, you can follow the instructions in the Preface
to the book. Alternatively, and at a minimum, first download and install
R for [MacOS](https://cran.r-project.org/bin/macosx/),
[Windows](https://cran.r-project.org/bin/windows/) or
[Linux](https://cran.r-project.org/bin/linux/), as appropriate. Launch
R, then type the following code at the Console prompt (`>`), hitting
return at the end of each line:

``` r

install.packages("socviz")
```

To install the development version of `socviz`, instead of
`install.packages("socviz")` do the following:

``` r

remotes::install_github("kjhealy/socviz")
```

Once everything has downloaded and been installed (which may take a
little while), load the `socviz` package:

``` r
library(socviz)
```

## More about the Datasets and Functions

The included datasets and functions are documented in the package and at
<https://kjhealy.github.io/socviz/reference/>.
