Skip to content

Commit

Permalink
add vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
lpantano committed Apr 29, 2024
1 parent 86a36cf commit 492d9c9
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
*.Rproj
test/*
inst/*/*/*/*/*/*html
inst/*/*/*/*/*/*csv
inst/*/*/*/*/*/*csv
inst/doc
4 changes: 4 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ Imports:
stringr,
ggplot2,
magrittr
Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export(list_cb_friendly_cols)
export(scale_color_cb_friendly)
export(scale_fill_cb_friendly)
import(ggplot2)
import(hues)
importFrom(magrittr,"%>%")
importFrom(stringr,str_replace_all)
1 change: 1 addition & 0 deletions R/bcbioR-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
#' @importFrom stringr str_replace_all
## usethis namespace: end
#' @import ggplot2
#' @import hues
NULL
4 changes: 4 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ This code will populate the folder with HCBC data structure guidelines and Rmd c
bcbio_templates(type="rnaseq", outpath="test_folder/reports")
```

### Discover more

Go to the vignette to know more `vignette("bcbioR_quick_start,package="bcbioR")`

## How to Contribute

You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this.
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ and Rmd code:
bcbio_templates(type="rnaseq", outpath="test_folder/reports")
```

### Discover more

Go to the vignette to know more
`vignette("bcbioR_quick_start,package="bcbioR")`

## How to Contribute

You’ll still need to render `README.Rmd` regularly, to keep `README.md`
Expand Down
12 changes: 0 additions & 12 deletions man/hello.Rd

This file was deleted.

2 changes: 2 additions & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html
*.R
44 changes: 44 additions & 0 deletions vignettes/bcbioR_quick_start.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "bcbioR quick start"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Quick_Start}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup}
library(bcbioR)
library(ggplot2)
```

# Color blind friendly palette

Compatible with `ggplot`.

```{r}
set.seed(596)
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
(d <- ggplot(dsamp, aes(carat, price)) +
geom_point(aes(colour = clarity)))
d + scale_color_cb_friendly()
```


And get the colors directly:

```{r}
cb_friendly_cols(1:16)
```
```{r}
library(hues)
swatch(cb_friendly_cols(1:16))
```

0 comments on commit 492d9c9

Please sign in to comment.