Skip to content

Commit

Permalink
Merge pull request #185 from LCBC-UiO/dev
Browse files Browse the repository at this point in the history
Ready for CRAN update
  • Loading branch information
osorensen authored Apr 6, 2024
2 parents be6a50d + f249b52 commit 7222a90
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 70 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: galamm
Title: Generalized Additive Latent and Mixed Models
Version: 0.1.1.9000
Version: 0.2.0
Authors@R: c(
person(given = "Øystein",
family = "Sørensen",
Expand Down
71 changes: 5 additions & 66 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,20 @@
## Submission note

This is a resubmission aimed at fixing current issues. There are three types of
issues, and the respective fixes are described under each header below:

### 1. Memory issues (clang-ASAN, gcc-ASAN, valgrind)

I was able to reproduce the error both using debug mode locally with 'R -d lldb'
and using the Docker image rocker/r-devel-san.
The issue was caused by attempting to access a vector element at a an index
'-2', which clearly does not work. This case has now been fixed, and the fix is
described in more detail here: https://github.com/LCBC-UiO/galamm/issues/165.

### 2. Errors on r-oldrelease

I here explain why the failure happened, and how it has been fixed.

Letting 'fam' be some model family, e.g., 'fam <- binomial()' or
'fam <- gaussian()', I had a test 'is.na(fam$dispersion)'. In R4.2.3 these
'fam' objects would not have an element named 'dispersion', and would cause a
fail. In R4.3.1 'fam' does have a 'dispersion' element, and
hence the test passed here. I have rewritten the code so it does not rely on
this element, and verified it using devtools::test_win_oldrelease(). The fix
is described in more detail here: https://github.com/LCBC-UiO/galamm/issues/167.

### 3. Errors on M1 Mac

On M1 Mac, 10 tests are skipped and 1 test fails. The failing test happens
because the expected deviance value differs from the computed deviance value
at 3rd decimal (885.7339 vs 885.7341). I have thus reduced the tolerance of this
test, and also confirmed that the version now being submitted works with the
R Mac Builder (test outputs provided below).

This is an update to the package which contains bug fixes, improvements of
the code base, and more documentation and examples.

## Test environments

* R development version with sanitizer support via rocker/r-devel-san.
* R 4.3.1 build with valgrind on a local Ubuntu 22.04.
* R Mac Builder (https://mac.r-project.org/macbuilder/submit.html)
* Windows, r-release, r-oldrelease, r-devel.
* Local Apple M1 Max in debug mode (R -d lldb) on R4.3.1.
* Local Apple M1 Max, on R4.3.1 and R4.2.3.
* Local Apple M1 Max, on R4.3.3.
* R-CMD-check via GitHub Actions on windows-latest, macOS-latest,
ubuntu-20.04 (release), and ubuntu-20.04 (devel).


## R CMD check results

### r-devel-san

0 ERRORs, 0 WARNINGs, 0 NOTEs

### R Mac Builder

0 ERRORs, 0 WARNINGs, 1 NOTE:

* checking installed package size ... NOTE
installed size is 24.1Mb
sub-directories of 1Mb or more:
doc 1.9Mb
libs 21.1Mb

### Windows, r-release, r-oldrelease, r-devel

0 ERRORs, 0 WARNINGs, 1 NOTE:

* checking CRAN incoming feasibility ... [15s] NOTE
Maintainer: 'Øystein Sørensen <oystein.sorensen@psykologi.uio.no>'

Days since last update: 4

### Local Apple M1 Max in debug model (R -d lldb)

0 ERRORs, 0 WARNINGs, 0 NOTEs

### Local Apple M1 Max, on R4.3.1 and R4.2.3.

0 ERRORs, 0 WARNINGs, 0 NOTEs

### GitHub Actions
There were 0 ERRORs, 0 WARNINGs, 0 NOTEs

0 ERRORs, 0 WARNINGs, 0 NOTEs
15 changes: 13 additions & 2 deletions data-raw/lifespan.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
# Simulate lifespan data from Section 4.1 in Sørensen et al. (2023)
library(tidyverse)
library(mvtnorm)
library(mgcv)
set.seed(3)
trajectories <- readRDS("data-raw/trajectories.rds")

# Fix trajectory for executive function:
mod <- gam(execfun_trajectory ~ s(age),
data = filter(trajectories, age < 25 | age > 50))

# Fix trajectory for episodic memory:
mod2 <- gam(epmem_trajectory ~ s(age),
data = filter(trajectories, age < 40 | age > 70))
plot(mod2)

epmem_fun <- approxfun(
trajectories$age,
trajectories$epmem_trajectory
predict(mod2, newdata = trajectories)
)
wmem_fun <- approxfun(
trajectories$age, trajectories$wmem_trajectory
)
execfun_fun <- approxfun(
trajectories$age, trajectories$execfun_trajectory
trajectories$age, predict(mod, newdata = trajectories)
)

n_ids <- 1000
Expand Down
Binary file modified data/lifespan.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion news.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# galamm (development versions)
# galamm version 0.2.0

- The print.summary.galamm() method does no longer print residual percentiles
with mixed response models. The version implemented until now had a bug, and
Expand Down

0 comments on commit 7222a90

Please sign in to comment.