Skip to content

Commit

Permalink
Merge pull request #41 from inbo/0.2.11
Browse files Browse the repository at this point in the history
0.2.11
  • Loading branch information
ThierryO committed Mar 30, 2022
2 parents 3eb0e9d + 81af114 commit 723b990
Show file tree
Hide file tree
Showing 27 changed files with 172 additions and 240 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check_on_different_r_os.yml
Expand Up @@ -64,6 +64,7 @@ jobs:
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
sudo apt-get install -y libcurl4-openssl-dev
- name: Install dependencies
run: |
Expand Down
7 changes: 4 additions & 3 deletions .zenodo.json
@@ -1,7 +1,7 @@
{
"title": "multimput: Using Multiple Imputation to Address Missing Data",
"version": "0.2.10",
"description": "Accompaning package for the paper: \"Working with population totals in the presence of with missing data\".",
"version": "0.2.11",
"description": "Accompanying package for the paper: \"Working with population totals in the presence of with missing data\".",
"creators": [
{
"name": "Onkelinx, Thierry",
Expand Down Expand Up @@ -34,5 +34,6 @@
"type": "ContactPerson",
"orcid": "https://orcid.org/0000-0001-8804-4216"
}
]
],
"language": "eng"
}
10 changes: 6 additions & 4 deletions CITATION.cff
Expand Up @@ -17,11 +17,13 @@ contact:
- email: info@inbo.be
name: Research Institute for Nature and Forest
title: 'multimput: Using Multiple Imputation to Address Missing Data'
version: 0.2.10
abstract: 'Accompaning package for the paper: "Working with population totals in the
presence of with missing data".'
version: 0.2.11
abstract: 'Accompanying package for the paper: "Working with population totals in
the presence of with missing data".'
license: GPL-3.0
type: software
doi: 10.5281/zenodo.598331
repository-code: https://github.com/inbo/multimput
identifiers: []
identifiers:
- type: url
value: https://inbo.github.io/multimput/
9 changes: 5 additions & 4 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: multimput
Title: Using Multiple Imputation to Address Missing Data
Version: 0.2.10
Version: 0.2.11
Authors@R: c(
person("Thierry", "Onkelinx", , "thierry.onkelinx@inbo.be", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8804-4216")),
Expand All @@ -11,11 +11,11 @@ Authors@R: c(
comment = c(ORCID = "0000-0002-6894-9402")),
person("Research Institute for Nature and Forest", , , "info@inbo.be", role = c("cph", "fnd"))
)
Description: Accompaning package for the paper: "Working with population
Description: Accompanying package for the paper: "Working with population
totals in the presence of with missing data".
License: GPL-3
URL: https://doi.org/10.5281/zenodo.598331,
https://github.com/inbo/multimput
https://github.com/inbo/multimput, https://inbo.github.io/multimput/
BugReports: https://github.com/inbo/multimput/issues
Depends:
R (>= 3.0.0)
Expand All @@ -41,8 +41,9 @@ Suggests:
testthat
VignetteBuilder:
knitr
Additional_repositories: https://inla.r-inla-download.org/R/testing
Additional_repositories: https://inla.r-inla-download.org/R/stable
Encoding: UTF-8
Language: en-GB
LazyData: TRUE
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
Expand Down
5 changes: 4 additions & 1 deletion NAMESPACE
Expand Up @@ -11,7 +11,7 @@ export(missing_current_count)
export(missing_observed)
export(missing_volunteer)
exportClasses(aggregatedImputed)
exportClasses(inla)
exportClasses(maybeInla)
exportClasses(rawImputed)
exportMethods(aggregate_impute)
exportMethods(impute)
Expand Down Expand Up @@ -39,9 +39,12 @@ importFrom(dplyr,summarise_at)
importFrom(dplyr,transmute)
importFrom(dplyr,ungroup)
importFrom(dplyr,vars)
importFrom(methods,getClassDef)
importFrom(methods,new)
importFrom(methods,setClass)
importFrom(methods,setClassUnion)
importFrom(methods,setGeneric)
importFrom(methods,setIs)
importFrom(methods,setMethod)
importFrom(methods,setOldClass)
importFrom(methods,setValidity)
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
@@ -1,3 +1,8 @@
# multimput 0.2.11

* Vignette runs without INLA.
Required to make the package build on https://inbo.r-universe.dev

# multimput 0.2.10

* Use checklist infrastructure.
Expand Down
2 changes: 1 addition & 1 deletion R/aggregate_impute.R
@@ -1,5 +1,5 @@
#' Aggregate an imputed dataset
#' @param object A rawImputed object.
#' @param object A `rawImputed` object.
#' @param grouping A vector of variables names to group the aggregation on.
#' @param fun The function to aggregate.
#' @param filter
Expand Down
4 changes: 2 additions & 2 deletions R/aggregated_imputed_class.R
@@ -1,9 +1,9 @@
#' The aggregatedImputed class
#' The `aggregatedImputed` class
#' Holds an aggregated imputation data set
#' @section Slots:
#' \describe{
#' \item{`Covariate`}{A data.frame with the covariates.}
#' \item{`Imputation`}{A matrix wih aggregated imputed values.}
#' \item{`Imputation`}{A matrix with aggregated imputed values.}
#' }
#' @name aggregatedImputed-class
#' @rdname aggregatedImputed-class
Expand Down
4 changes: 2 additions & 2 deletions R/generate_data.R
@@ -1,6 +1,6 @@
#' Generate simulated data
#'
#' Generate data for a regural monitoring design.
#' Generate data for a regular monitoring design.
#' The counts follow a negative binomial distribution with given size parameters
#' and the true mean mu depending on a year, period and site effect.
#' All effects are independent from each other and have, on the log-scale, a
Expand All @@ -15,7 +15,7 @@
#' Defaults to `FALSE`.
#' @param site_factor Convert site to a factor.
#' Defaults to `FALSE`.
#' @param trend The longterm linear trend on the log-scale.
#' @param trend The long-term linear trend on the log-scale.
#' @param sd_rw_year The standard deviation of the year effects on the
#' log-scale.
#' @param amplitude_period The amplitude of the periodic effect on the
Expand Down
20 changes: 14 additions & 6 deletions R/import_s3_classes.R
@@ -1,8 +1,16 @@
#' inla
#'
#' the inla class is defined in the INLA package
#' @name inla-class
#' @seealso \link[INLA]{inla}
#' @importFrom methods setOldClass
#' @exportClass inla
setOldClass("inla")

#' The `maybeInla` class
#'
#' A superclass holding either `NULL` or an object of the `inla` class.
#' @importFrom methods setClassUnion
#' @exportClass maybeInla
setClassUnion("maybeInla", "NULL")

#' @importFrom methods getClassDef setIs
.onLoad <- function(...) {
if (requireNamespace("INLA", quietly = TRUE)) {
setIs("inla", "maybeInla", classDef = getClassDef("inla", package = "INLA"))
}
}
5 changes: 3 additions & 2 deletions R/impute_inla.R
Expand Up @@ -23,11 +23,12 @@
#' using `B:0` threads.
setMethod(
f = "impute",
signature = signature(model = "inla"),
signature = signature(model = "maybeInla"),
definition = function(
model, ..., seed = 0L, num_threads = NULL, parallel_configs = TRUE,
n_imp = 19
) {
assert_that(!is.null(model), msg = "model should be an inla object")
check_old_names(..., old_names = c(n_imp = "n.imp"))
assert_that(is.count(n_imp))
assert_that(
Expand Down Expand Up @@ -85,7 +86,7 @@ setMethod(
.y = hyperpar[[grep("size for the nbinomial", colnames(hyperpar))]]
),
poisson = map_dfr(
.x = latent, .f = rpois, n = length(missing_obs)
.x = latent, .f = ~rpois(n = length(missing_obs), lambda = exp(.x))
),
stop(
"Imputations from the '", model$.args$family, "' family not yet defined.
Expand Down
4 changes: 2 additions & 2 deletions R/raw_imputed_class.R
@@ -1,12 +1,12 @@
#' The rawimputed class
#' The `rawImputed` class
#' Holds a dataset and imputed values
#' @section Slots:
#' \describe{
#' \item{`Data`}{A data.frame with the data.}
#' \item{`Response`}{A character holding the name of the response variable.}
#' \item{`Minimum`}{An optional character holding the name of the variable
#' with the minimum.}
#' \item{`Imputation`}{A matrix wih imputed values.}
#' \item{`Imputation`}{A matrix with imputed values.}
#' }
#' @name rawImputed-class
#' @rdname rawImputed-class
Expand Down
8 changes: 4 additions & 4 deletions README.md
@@ -1,5 +1,5 @@
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Lifecycle:maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing-1)
[![Life cycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing-1)
[![License](http://img.shields.io/badge/license-GPL--3-blue.svg?style=flat)](http://www.gnu.org/licenses/gpl-3.0.html)
[![Release](https://img.shields.io/github/release/qubyte/rubidium.svg)](https://github.com/inbo/multimput/releases)
[![check package](https://github.com/inbo/multimput/actions/workflows/check_on_branch.yml/badge.svg)](https://github.com/inbo/multimput/actions/workflows/check_on_branch.yml)
Expand All @@ -15,7 +15,7 @@
## Rationale

The `multimput` package was originally intended to provide the data and code to replicate the results of Onkelinx, Devos, and Quataert (2016).
This paper is freely available at <http://dx.doi.org/10.1007/s10336-016-1404-9>.
This paper is freely available at http://dx.doi.org/10.1007/s10336-016-1404-9.
The functions were all rewritten to make them more user-friendly and more generic.
In order to make the package more compact, we removed the original code and data starting for version 0.2.6.
However both the original code and data remain available in [the older releases](https://github.com/inbo/multimput/releases).
Expand All @@ -30,13 +30,13 @@ This package requires the `INLA` package.
You need to install it with `install.packages("INLA", repos = "https://inla.r-inla-download.org/R/stable")`.
If this fails you can use `remotes::install_github("inbo/INLA")`.
Note that the latter is just a read-only mirror which is infrequently updated.
Hence installing `INLA` from <https://inla.r-inla-download.org> is highly recommended.
Hence installing `INLA` from https://inla.r-inla-download.org is highly recommended.

Once `INLA` is installed, you can install `multimput` using the `remotes` package: `remotes::install_github("inbo/multimput", build_vignettes = TRUE)`).
To view the vignette use `vignette("Impute", package = "multimput")`.
The vignette is also available at https://inbo.github.io/multimput/articles/impute.html

A docker image with all the required dependencies is available from <https://hub.docker.com/r/inbobmk/multimput/>.
A docker image with all the required dependencies is available from https://hub.docker.com/r/inbobmk/multimput/.
Use `docker pull inbobmk/multimput` to get it.

## Folder structure
Expand Down
2 changes: 1 addition & 1 deletion checklist.yml
Expand Up @@ -13,7 +13,7 @@ allowed:
Suggests or Enhances not in mainstream repositories:
INLA
Availability using Additional_repositories specification:
INLA yes https://inla.r-inla-download.org/R/testing
INLA yes https://inla.r-inla-download.org/R/stable
citation_roles:
- aut
- cre
6 changes: 3 additions & 3 deletions inst/CITATION
Expand Up @@ -2,12 +2,12 @@ citHeader("To cite `multimput` in publications please use:")
# begin checklist entry
citEntry(
entry = "Manual",
title = "multimput: Using Multiple Imputation to Address Missing Data. Version 0.2.10",
title = "multimput: Using Multiple Imputation to Address Missing Data. Version 0.2.11",
author = c(person(given = "Thierry", family = "Onkelinx"), person(given = "Koen", family = "Devos"), person(given = "Paul", family = "Quataert")),
year = 2022,
url = "https://doi.org/10.5281/zenodo.598331",
abstract = "Accompaning package for the paper: \"Working with population totals in the presence of with missing data\".",
textVersion = "Onkelinx, Thierry; Devos, Koen; Quataert, Paul (2022) multimput: Using Multiple Imputation to Address Missing Data. Version 0.2.10. https://doi.org/10.5281/zenodo.598331, https://github.com/inbo/multimput",
abstract = "Accompanying package for the paper: \"Working with population totals in the presence of with missing data\".",
textVersion = "Onkelinx, Thierry; Devos, Koen; Quataert, Paul (2022) multimput: Using Multiple Imputation to Address Missing Data. Version 0.2.11. https://doi.org/10.5281/zenodo.598331, https://github.com/inbo/multimput, https://inbo.github.io/multimput/",
doi = "10.5281/zenodo.598331",
)
# end checklist entry
2 changes: 2 additions & 0 deletions inst/WORDLIST
@@ -0,0 +1,2 @@
Codecov
INLA
2 changes: 1 addition & 1 deletion man/aggregate_impute.Rd

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

6 changes: 3 additions & 3 deletions man/aggregatedImputed-class.Rd

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

2 changes: 1 addition & 1 deletion man/deprecated.Rd

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

4 changes: 2 additions & 2 deletions man/generate_data.Rd

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

4 changes: 2 additions & 2 deletions man/impute.Rd

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

11 changes: 0 additions & 11 deletions man/inla-class.Rd

This file was deleted.

9 changes: 9 additions & 0 deletions man/maybeInla-class.Rd

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

6 changes: 3 additions & 3 deletions man/rawImputed-class.Rd

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

1 change: 1 addition & 0 deletions multimput.Rproj
Expand Up @@ -17,6 +17,7 @@ StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageCleanBeforeInstall: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageCheckArgs: --as-cran
PackageRoxygenize: rd,collate,namespace

0 comments on commit 723b990

Please sign in to comment.