Skip to content

Commit

Permalink
Merge pull request #13 from DanChaltiel/patch-1
Browse files Browse the repository at this point in the history
Added some use case in the readme
  • Loading branch information
nanxstats authored Mar 8, 2023
2 parents 78a24ce + 5858486 commit 65a5aad
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,27 @@ remotes::install_github("nanxstats/ggsci")
[Browse the vignette](https://nanx.me/ggsci/articles/ggsci.html) (or open with
`vignette("ggsci")` in R) for a quick-start guide.

## Usage

```{r, eval=FALSE}
library(ggsci)
#in base plots
x = factor(mtcars$cyl, labels=pal_jama()(3))
plot(x = mtcars$mpg, y = mtcars$hp, col = x, pch = 16)
#in ggplot2
library(ggplot2)
ggplot(mtcars, aes(x = mpg, y = hp, color = factor(cyl))) +
geom_point() +
scale_color_nejm()
#in ggplot2, using options
options(ggplot2.discrete.colour=ggsci::scale_colour_lancet)
ggplot(mtcars, aes(x = mpg, y = hp, color = factor(cyl))) +
geom_point()
```

## Gallery

```{r}
Expand Down

0 comments on commit 65a5aad

Please sign in to comment.