Skip to content

Commit

Permalink
Merge pull request #6 from ropensci/dev
Browse files Browse the repository at this point in the history
Minor changes to docs
  • Loading branch information
RWParsons authored Jan 11, 2024
2 parents 0e0144f + 0f04306 commit 18629de
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 60 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: GLMMcosinor
Title: Fit a Cosinor Model Using a Generalised Mixed Modelling Framework
Version: 0.2.0
Version: 0.2.0.9000
Authors@R: c(
person("Rex", "Parsons", , "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6053-8174")),
Expand All @@ -12,6 +12,7 @@ Authors@R: c(
comment = c(ORCID = "0000-0002-7147-4778")),
person("Prasad", "Chunduri", role = c("ctb", "fnd"),
comment = c(ORCID = "0000-0001-7297-7580")),
person("Margaret", "Doyle", role = "ctb"),
person("Michael", "Sachs", role = "rev",
comment = c(ORCID = "0000-0002-1279-8676")),
person("Joaquin", "Cavieres", role = "rev",
Expand All @@ -24,7 +25,7 @@ Description: Allows users to fit a cosinor model using the 'glmmTMB' framework.
Cornelissen (2014) <doi:10.1186/1742-4682-11-16>.
License: GPL (>= 3)
URL: https://github.com/ropensci/GLMMcosinor,
https://ropensci.github.io/GLMMcosinor/
https://docs.ropensci.org/GLMMcosinor/
BugReports: https://github.com/ropensci/GLMMcosinor/issues
Imports:
assertthat,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# GLMMcosinor (development version)

# GLMMcosinor 0.2.0

* Successful peer review from rOpenSci!
Expand Down
2 changes: 1 addition & 1 deletion R/GLMMcosinor-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#' models with cosinor terms
#' @description
#' To learn more about how to use GLMMcosinor, see the vignettes at the
#' \href{https://ropensci.github.io/GLMMcosinor/}{website} or using
#' \href{https://docs.ropensci.org/GLMMcosinor/}{website} or using
#' the following code:
#'
#' `browseVignettes(package = "GLMMcosinor")`
Expand Down
23 changes: 16 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ knitr::opts_chunk$set(
```


# GLMMcosinor <a href='https://ropensci.github.io/GLMMcosinor/'><img src='man/figures/logo.png' align="right" height="139" /></a>
# GLMMcosinor <a href='https://docs.ropensci.org/GLMMcosinor/'><img src='man/figures/logo.png' align="right" height="139" /></a>

<!-- badges: start -->
[![R-CMD-check](https://github.com/ropensci/GLMMcosinor/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/GLMMcosinor/actions/workflows/R-CMD-check.yaml)
Expand All @@ -34,14 +34,22 @@ knitr::opts_chunk$set(
<!-- badges: end -->


The goal of `{GLMMcosinor}` is to fit a cosinor model to rhythmic data except with all the flexibility and functionality of a generalised linear (mixed-) model (GLM) framework using `{glmmTMB}`.
The goal of `{GLMMcosinor}` is to fit a cosinor model to rhythmic data with all
the flexibility and functionality of a generalised linear (mixed-) model (GLM)
framework using `{glmmTMB}`.

For an introduction to the cosinor model, see the [getting started vignette](https://ropensci.github.io/GLMMcosinor/articles/GLMMcosinor.html).
For an introduction to the cosinor model, see the [getting started vignette](https://docs.ropensci.org/GLMMcosinor/articles/GLMMcosinor.html).

Existing statistical software for circadian data analyses (including `cosinor` [@sachs2023cosinor] or `circacompare` [@parsons2020circacompare]) allow the user to fit data using a regression model, but many are limited due to their inability to specify a link function, multiple components, or a hierarchical structure. `GLMMcosinor` aims to be comprehensive and flexible and is an improvement on other implementations of the cosinor model in R or Python. See table below for features available within currently available methods.
Existing statistical software for circadian data analyses (including `cosinor`
[@sachs2023cosinor] or `circacompare` [@parsons2020circacompare]) allows users
to fit regression models to rhythmic data, but many are limited due to their
inability to specify a link function, multiple components, or a hierarchical
structure. `GLMMcosinor` aims to be comprehensive and flexible and is an
improvement on other implementations of cosinor model fitting in R or Python.
See table below for features available within currently available methods.

`GLMMcosinor` makes use of the `glmmTMB` package framework for estimation of
linear cosinor coefficients. If the model has no random effects, `glmmTMB` uses
`GLMMcosinor` makes use of the `glmmTMB` package framework for estimation of the
cosinor model. If the model has no random effects, `glmmTMB` uses
maximum likelihood estimation to estimate the linear coefficients of the model.
For models with random effects, a Laplace approximation is used to integrate
over the random effects. This approximation is handled by the
Expand All @@ -63,7 +71,8 @@ flextable::save_as_image(

## Installation

You can install the development version of GLMMcosinor from [GitHub](https://github.com/) with:
You can install the development version of GLMMcosinor from
[GitHub](https://github.com/) with:

``` r
# install.packages("remotes")
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

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

# GLMMcosinor <a href='https://ropensci.github.io/GLMMcosinor/'><img src='man/figures/logo.png' align="right" height="139" /></a>
# GLMMcosinor <a href='https://docs.ropensci.org/GLMMcosinor/'><img src='man/figures/logo.png' align="right" height="139" /></a>

<!-- badges: start -->

Expand All @@ -18,26 +18,26 @@ Review](https://badges.ropensci.org/603_status.svg)](https://github.com/ropensci
<!-- badges: end -->

The goal of `{GLMMcosinor}` is to fit a cosinor model to rhythmic data
except with all the flexibility and functionality of a generalised
linear (mixed-) model (GLM) framework using `{glmmTMB}`.
with all the flexibility and functionality of a generalised linear
(mixed-) model (GLM) framework using `{glmmTMB}`.

For an introduction to the cosinor model, see the [getting started
vignette](https://ropensci.github.io/GLMMcosinor/articles/GLMMcosinor.html).
vignette](https://docs.ropensci.org/GLMMcosinor/articles/GLMMcosinor.html).

Existing statistical software for circadian data analyses (including
`cosinor` (Sachs 2023) or `circacompare` (Parsons et al. 2020)) allow
the user to fit data using a regression model, but many are limited due
to their inability to specify a link function, multiple components, or a
hierarchical structure. `GLMMcosinor` aims to be comprehensive and
flexible and is an improvement on other implementations of the cosinor
model in R or Python. See table below for features available within
`cosinor` (Sachs 2023) or `circacompare` (Parsons et al. 2020)) allows
users to fit regression models to rhythmic data, but many are limited
due to their inability to specify a link function, multiple components,
or a hierarchical structure. `GLMMcosinor` aims to be comprehensive and
flexible and is an improvement on other implementations of cosinor model
fitting in R or Python. See table below for features available within
currently available methods.

`GLMMcosinor` makes use of the `glmmTMB` package framework for
estimation of linear cosinor coefficients. If the model has no random
effects, `glmmTMB` uses maximum likelihood estimation to estimate the
linear coefficients of the model. For models with random effects, a
Laplace approximation is used to integrate over the random effects. This
estimation of the cosinor model. If the model has no random effects,
`glmmTMB` uses maximum likelihood estimation to estimate the linear
coefficients of the model. For models with random effects, a Laplace
approximation is used to integrate over the random effects. This
approximation is handled by the
[`TMB`](https://cran.r-project.org/package=TMB) package which uses
automatic differentiation of the joint likelihood function to
Expand Down Expand Up @@ -114,7 +114,7 @@ citation("GLMMcosinor")
#>
#> Parsons R, Jayasinghe O, White N, Rawashdeh O (2024). _GLMMcosinor:
#> Fit a Cosinor Model Using a Generalised Mixed Modelling Framework_. R
#> package version 0.2.0, https://ropensci.github.io/GLMMcosinor/,
#> package version 0.2.0.9000, https://docs.ropensci.org/GLMMcosinor/,
#> <https://github.com/ropensci/GLMMcosinor>.
#>
#> A BibTeX entry for LaTeX users is
Expand All @@ -124,8 +124,8 @@ citation("GLMMcosinor")
#> Framework},
#> author = {Rex Parsons and Oliver Jayasinghe and Nicole White and Oliver Rawashdeh},
#> year = {2024},
#> note = {R package version 0.2.0,
#> https://ropensci.github.io/GLMMcosinor/},
#> note = {R package version 0.2.0.9000,
#> https://docs.ropensci.org/GLMMcosinor/},
#> url = {https://github.com/ropensci/GLMMcosinor},
#> }
```
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url: https://ropensci.github.io/GLMMcosinor/
url: https://docs.ropensci.org/GLMMcosinor/
template:
bootstrap: 5
params:
Expand Down
11 changes: 8 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"identifier": "GLMMcosinor",
"description": "Allows users to fit a cosinor model using the 'glmmTMB' framework. This extends on existing cosinor modelling packages, including 'cosinor' and 'circacompare', by including a wide range of available link functions and the capability to fit mixed models. The cosinor model is described by Cornelissen (2014) <doi:10.1186/1742-4682-11-16>.",
"name": "GLMMcosinor: Fit a Cosinor Model Using a Generalised Mixed Modelling Framework",
"relatedLink": "https://ropensci.github.io/GLMMcosinor/",
"relatedLink": "https://docs.ropensci.org/GLMMcosinor/",
"codeRepository": "https://github.com/ropensci/GLMMcosinor",
"issueTracker": "https://github.com/ropensci/GLMMcosinor/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.2.0",
"version": "0.2.0.9000",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -47,6 +47,11 @@
"givenName": "Prasad",
"familyName": "Chunduri",
"@id": "https://orcid.org/0000-0001-7297-7580"
},
{
"@type": "Person",
"givenName": "Margaret",
"familyName": "Doyle"
}
],
"funder": [
Expand Down Expand Up @@ -329,7 +334,7 @@
},
"SystemRequirements": null
},
"fileSize": "3088.62KB",
"fileSize": "3088.739KB",
"releaseNotes": "https://github.com/ropensci/GLMMcosinor/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/GLMMcosinor/blob/main/README.md",
"contIntegration": ["https://github.com/ropensci/GLMMcosinor/actions/workflows/R-CMD-check.yaml", "https://app.codecov.io/gh/ropensci/GLMMcosinor?branch=main"],
Expand Down
5 changes: 3 additions & 2 deletions man/GLMMcosinor-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions vignettes/GLMMcosinor.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ also be included in the formula as well as random effects. Additionally,
zero-inflation (`ziformula`) and dispersion (`dispformula`) formulae can
be incorporated if required. For detailed examples of how to specify
these types of models, see the
[mixed-models](https://ropensci.github.io/GLMMcosinor/articles/mixed-models.html),
[model-specification](https://ropensci.github.io/GLMMcosinor/articles/model-specification.html)
[mixed-models](https://docs.ropensci.org/GLMMcosinor/articles/mixed-models.html),
[model-specification](https://docs.ropensci.org/GLMMcosinor/articles/model-specification.html)
and
[multiple-components](https://ropensci.github.io/GLMMcosinor/articles/multiple-components.html)
[multiple-components](https://docs.ropensci.org/GLMMcosinor/articles/multiple-components.html)
vignettes.

For example, consider the following model and its output:
Expand Down Expand Up @@ -268,17 +268,17 @@ The `cglmm()` function allows you to specify different types of cosinor
models with or without grouping variables. The function can also
generate dispersion models and zero-inflation models. For more detailed
explanations and examples, see the
[model-specification](https://ropensci.github.io/GLMMcosinor/articles/model-specification.html)
[model-specification](https://docs.ropensci.org/GLMMcosinor/articles/model-specification.html)
article.

Additionally, the `cglmm()` function provides more advanced
functionality for multi-component models, and detailed explanations can
be found in the
[multiple-components](https://ropensci.github.io/GLMMcosinor/articles/multiple-components.html)
[multiple-components](https://docs.ropensci.org/GLMMcosinor/articles/multiple-components.html)
article.

The `cglmm()` function also allows mixed model specification. See the
[mixed-models](https://ropensci.github.io/GLMMcosinor/articles/mixed-models.html)
[mixed-models](https://docs.ropensci.org/GLMMcosinor/articles/mixed-models.html)
article for more details.

## Using `summary()` and testing for differences between estimates
Expand Down Expand Up @@ -468,7 +468,7 @@ generated plot will have x-limits corresponding to the minimum and
maximum values of the time-vector in the original dataframe, although
the x-limits can be manually defined by the user using the `xlims`
argument. The details of using the `autoplot` function are found in the
[model-visualisations](https://ropensci.github.io/GLMMcosinor/articles/model-visualisations.html)
[model-visualisations](https://docs.ropensci.org/GLMMcosinor/articles/model-visualisations.html)
vignette.

## References
4 changes: 2 additions & 2 deletions vignettes/data-simulations.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "data-simulations"
title: "Simulating data"
author: "Oliver Jayasinghe and Rex Parsons"
output: rmarkdown::html_vignette
vignette: >
Expand All @@ -19,7 +19,7 @@ knitr::opts_chunk$set(
library(GLMMcosinor)
```

## Using: 'simulate_cosinor.R'
## Simulating rhythmic data

`simulate_cosinor` allows users to simulate circadian data from Gaussian, Gamma, Binomial, or Poisson distributions. It also supports generation of multi-component data, as well as simulation of grouped data with two levels.

Expand Down
4 changes: 2 additions & 2 deletions vignettes/mixed-models.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "mixed-models"
title: "Mixed models"
author: "Oliver Jayasinghe and Rex Parsons"
output: rmarkdown::html_vignette
vignette: >
Expand All @@ -15,7 +15,7 @@ knitr::opts_chunk$set(
)
```

```{r setup}
```{r setup, message=FALSE}
library(GLMMcosinor)
library(dplyr)
library(ggplot2)
Expand Down
16 changes: 8 additions & 8 deletions vignettes/model-specification.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "model-specification"
title: "Model specification"
author: "Oliver Jayasinghe and Rex Parsons"
output: rmarkdown::html_vignette
vignette: >
Expand All @@ -24,7 +24,7 @@ knitr::opts_chunk$set(
#' @srrstats {RE1.1}
```

```{r setup}
```{r setup, message=FALSE}
library(GLMMcosinor)
library(dplyr)
```
Expand Down Expand Up @@ -95,10 +95,10 @@ variables in the `data.frame`. Any other combination of covariates can
also be included in the formula as well as random effects and
zero-inflation (`ziformula`) and dispersion (`dispformula`) formulae.
For detailed examples of how to specify models, see the
[mixed-models](https://ropensci.github.io/GLMMcosinor/articles/mixed-models.html),
[model-specification](https://ropensci.github.io/GLMMcosinor/articles/model-specification.html)
[mixed-models](https://docs.ropensci.org/GLMMcosinor/articles/mixed-models.html),
[model-specification](https://docs.ropensci.org/GLMMcosinor/articles/model-specification.html)
and
[multiple-components](https://ropensci.github.io/GLMMcosinor/articles/multiple-components.html)
[multiple-components](https://docs.ropensci.org/GLMMcosinor/articles/multiple-components.html)
vignettes.

## Using cglmm()
Expand Down Expand Up @@ -144,7 +144,7 @@ The output shows the estimates for the raw coefficients in addition to
the transformed estimates for amplitude (amp) and acrophase (acr) and
MESOR (`(Intercept)`). The previous section of this vignette: [An
overview of the statistical methods used for parameter
estimation](https://ropensci.github.io/GLMMcosinor/articles/GLMMcosinor.html#an-overview-of-the-statistical-methods-used-for-parameter-estimation)
estimation](https://docs.ropensci.org/GLMMcosinor/articles/GLMMcosinor.html#an-overview-of-the-statistical-methods-used-for-parameter-estimation)
outlines the difference between the raw coefficients and the transformed
coefficients.

Expand Down Expand Up @@ -358,7 +358,7 @@ component, we would specify the `group` argument as
`group = c("group", NA))`.

For a detailed explanation of how to specify multi-component models, see
[multiple-components](https://ropensci.github.io/GLMMcosinor/articles/multiple-components.html)
[multiple-components](https://docs.ropensci.org/GLMMcosinor/articles/multiple-components.html)

### Dispersion and zero-inflation model specification

Expand Down Expand Up @@ -410,7 +410,7 @@ models will not be generated in the output.
number of components in the dispersion and zero-inflation formulas were
chosen arbitrarily and purely for demonstration.*

## Using: 'summary(cglmm)'
## Using `summary(cglmm)`

The `summary()` method for `cglmm` objects provides a more detailed
summary of the model and its parameter estimates and uncertainty. It
Expand Down
Loading

0 comments on commit 18629de

Please sign in to comment.