-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
85 lines (59 loc) · 2.2 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# gghisse
<!-- badges: start -->
![R-CMD-check-bioc](https://github.com/discindo/gghisse/workflows/R-CMD-check-bioc/badge.svg)
[![Codecov test coverage](https://codecov.io/gh/discindo/gghisse/branch/master/graph/badge.svg)](https://codecov.io/gh/discindo/gghisse?branch=master)
<!-- badges: end -->
The goal of `gghisse` is to provide additional ways to visualize results from `hisse` family models ([HiSSE](https://cran.r-project.org/web/packages/hisse/index.html) objects)
## Installation
<!-- You can install the released version of `gghisse` from [CRAN](https://CRAN.R-project.org) with: -->
<!-- ``` r -->
<!-- install.packages("gghisse") -->
<!-- ``` -->
The development version can be installed from from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("discindo/gghisse")
```
A CRAN submission is forthcoming.
## Web application
To see the main functionality and example code, visit the Shiny web application: https://diatom.shinyapps.io/hisse-web/
## Example usage
```{r}
library("gghisse")
data("diatoms")
processed_hisse <- gghisse::h_process_recon(hisse_recon=diatoms$cid4_recon)
hisse_rates_plot <- gghisse::h_scatterplot(
processed_recon=processed_hisse,
parameter="turnover")
```
As `gghisse` is built on top of `ggplot2`, modifications to `gghisse` plots are easy with the familiar `ggplot` functions. For example, changing X axis tick labels:
```{r}
hisse_rates_plot +
scale_x_discrete(breaks=c(0,1), labels=c("plankton", "benthos"))
```
Or changing the position of the legend
```{r}
hisse_rates_plot +
scale_x_discrete(breaks=c(0,1), labels=c("plankton", "benthos")) +
theme(legend.position="top")
```
Or using expressions (for Greek letters) in the axis labels
```{r}
hisse_rates_plot +
scale_x_discrete(breaks=c(0,1), labels=c("plankton", "benthos")) +
theme(legend.position="top") +
labs(y=expression(paste(tau, "=", lambda, "+", mu))) +
theme(axis.text.y=element_text(size=15))
```