Skip to content

Commit

Permalink
updating CI (caching of R packages) and proper namespace calling of l…
Browse files Browse the repository at this point in the history
…me function
  • Loading branch information
kkholst committed Dec 20, 2023
1 parent 9b92b51 commit 36d9a98
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,29 @@ jobs:
with:
use-public-rspm: true

- name: Cache R packages
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
dependencies: '"all"'
cache: true
extra-packages: |
any::rcmdcheck
any::pkgdown
any::remotes
any::covr
needs: check

# - name: Cache R packages
# uses: actions/cache@v3
# with:
# path: ${{ env.R_LIBS_USER }}
# key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
# restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install R dependencies
run: |
install.packages("remotes", repos="https://cloud.r-project.org")
remotes::install_github("kkholst/gof")
remotes::install_deps(".", dep=T, upgrade=T)
remotes::install_cran(c("pkgdown","covr","rcmdcheck"))
remotes::install_bioc("Rgraphviz", upgrade="always")
# remotes::install_bioc("Rgraphviz", upgrade="always")
shell: Rscript {0}

- name: Check
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-inference.R
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ test_that("Random slope model", {
dd$num <- dd$num+runif(nrow(dd),0,0.2)
dd0 <- dd[-c(1:2*3),]
library(lme4)
l <- lme(y ~ 1+num, random=~1+num|id, data=dd, method="ML")
l <- nlme::lme(y ~ 1+num, random=~1+num|id, data=dd, method="ML")
##l0 <- lmer(y~ 1+num +(1+num|id),dd,REML=FALSE)
sl0 <- lava:::varcomp(l)

Expand All @@ -340,7 +340,7 @@ test_that("Random slope model", {
testthat::expect_output(e0 <- estimate(m0,d0,missing=TRUE,param="none",control=list(method="NR",constrain=FALSE,start=coef(e),trace=1)),
"Iter=")
## l0 <- lmer(y ~ 1 + num + (1 + num | id), dd0, REML = FALSE)
l0 <- lme(y~ 1+num, random=~1+num|id, data=dd0, method="ML")
l0 <- nlme::lme(y~ 1+num, random=~1+num|id, data=dd0, method="ML")
testthat::expect_true((logLik(l0)-logLik(e0))^2<1e-5)

m1 <- lvm(c(y1[0:v],y2[0:v],y3[0:v])~1*u)
Expand Down

0 comments on commit 36d9a98

Please sign in to comment.