https://github.com/angelovangel/tidydrc
tidy modelling of dose-response relationships with the drc package
https://github.com/angelovangel/tidydrc
dose-response-modeling drc tidy-data
Last synced: 4 months ago
JSON representation
tidy modelling of dose-response relationships with the drc package
- Host: GitHub
- URL: https://github.com/angelovangel/tidydrc
- Owner: angelovangel
- License: mit
- Created: 2019-02-20T19:19:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-04T15:43:17.000Z (about 5 years ago)
- Last Synced: 2024-01-27T06:39:34.946Z (over 2 years ago)
- Topics: dose-response-modeling, drc, tidy-data
- Language: R
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tidydrc
tidydrc
## Description
Tidy modelling of dose-response relationships with the `drc` package in `R`.
This is a wrapper for [`drc`](https://cran.r-project.org/web/packages/drc/index.html) by Christian Ritz, which is probably the best package for modelling dose-response.
`tidydrc` contains two functions which make it easier to generate and plot these models. Install it with:
`devtools::install_github("angelovangel/tidydrc")`
## Examples
The `tidydrc_model()` function returns a dataframe with list-columns (the data,
predictions and coefficients). It is thus easy to implement in tidy workflows.
For example, to fit Michaelis-Menten kinetics models for treated and untreated samples in
the `Puromycin` dataset (built-in) and get the Km values with std. error:
```r
mm <- tidydrc_model(Puromycin, conc, rate, model = MM.3(), state)
names(mm$drmod) <- as.character(mm$state)
map(mm$drmod, ED, 50) %>% map_df(as_tibble, .id = "sample")
```
The list-column dataframe can be directly piped to `tidydrc_plot()`
```r
tidydrc_model(S.alba, Dose, DryMatter, model = LL.4(), Herbicide) %>%
tidydrc_plot(ed50 = TRUE, color = ~Herbicide) +
scale_x_log10()
```
A more involved example...
## References
[Ritz, C., Baty, F., Streibig, J. C., Gerhard, D. (2015) Dose-Response Analysis Using R PLOS ONE, 10(12), e0146021](http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0146021)