From 6a0790dd0403c13c235428b0356942ab18b8de64 Mon Sep 17 00:00:00 2001 From: Klaus Holst Date: Mon, 6 Jan 2025 14:16:29 +0100 Subject: [PATCH] cran prep --- R/lava-package.R | 2 +- man/internal.Rd | 1 + man/ksmooth2.Rd | 5 ++++- tests/testthat/test-influence.R | 16 ++++++++-------- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/R/lava-package.R b/R/lava-package.R index 9ead9789..6bb89a8a 100644 --- a/R/lava-package.R +++ b/R/lava-package.R @@ -251,7 +251,7 @@ NULL ##' starter.multigroup ##' addattr modelPar modelVar matrices pars pars.lvm ##' pars.lvmfit pars.glm score.glm procdata.lvmfit modelPar modelVar -##' matrices reorderdata graph2lvm igraph.lvm subgraph finalize +##' mat.lvm matrices reorderdata graph2lvm igraph.lvm subgraph finalize ##' index.lvm index.lvmfit index reindex index<- ##' rmvn0 dmvn0 logit expit tigol ##' randomslope randomslope<- lisrel variances offdiags describecoef diff --git a/man/internal.Rd b/man/internal.Rd index 3c3ff81d..bce5b43b 100644 --- a/man/internal.Rd +++ b/man/internal.Rd @@ -17,6 +17,7 @@ \alias{pars.glm} \alias{score.glm} \alias{procdata.lvmfit} +\alias{mat.lvm} \alias{reorderdata} \alias{graph2lvm} \alias{igraph.lvm} diff --git a/man/ksmooth2.Rd b/man/ksmooth2.Rd index fc14fc99..3059713d 100644 --- a/man/ksmooth2.Rd +++ b/man/ksmooth2.Rd @@ -37,9 +37,10 @@ ksmooth2( Plot/estimate surface } \examples{ +if (requireNamespace("KernSmooth")) {##' ksmooth2(rmvn0(1e4,sigma=diag(2)*.5+.5),c(-3.5,3.5),h=1, rgl=FALSE,theta=30) - +##' if (interactive()) { ksmooth2(rmvn0(1e4,sigma=diag(2)*.5+.5),c(-3.5,3.5),h=1) ksmooth2(function(x,y) x^2+y^2, c(-20,20)) @@ -60,4 +61,6 @@ if (!inherits(try(find.package("fields"),silent=TRUE),"try-error")) { f <- function(x,y) 1-sqrt(x^2+y^2) ksmooth2(f,c(-1,1),rgl=FALSE,image=fields::image.plot) } + +} } diff --git a/tests/testthat/test-influence.R b/tests/testthat/test-influence.R index 720c5f5c..d8f82159 100644 --- a/tests/testthat/test-influence.R +++ b/tests/testthat/test-influence.R @@ -22,23 +22,23 @@ test_that("merge, IC, estimate with 'id' argument", { l <- glm(y ~ x, data=d) e1 <- estimate(l, id=d$id1) - e <- merge(estimate(l), estimate(l), id=list(d$id, d$id1)) - V0 <- vcov(e) - V1 <- vcov(estimate(e1, id=c(1,2,2,3,4))) + V1 <- vcov(e1) + e0 <- estimate(e1, id=c(1,2,2,3,4)) + V0 <- vcov(e0) if (requireNamespace("geepack",quietly=TRUE)) { V <- summary(geepack::geeglm(y ~ x, id=d$id0, data=d))$cov.scaled testthat::expect_true(sum((V - V0)^2) < 1e-12) - testthat::expect_true(sum((V - V1)^2) < 1e-12) } - testthat::expect_true(sum((vcov(e1) - vcov(e)[3:4,3:4])^2) < 1e-12) - testthat::expect_true(sum((V1 - vcov(e)[1:2,1:2])^2) < 1e-12) + e <- merge(estimate(l), estimate(l), id=list(d$id, d$id1)) + testthat::expect_true(sum((V1 - vcov(e)[3:4,3:4])^2) < 1e-12) + testthat::expect_true(sum((V0 - vcov(e)[1:2,1:2])^2) < 1e-12) ee <- estimate(e, id=c(1,2,3,4,2,2)) VV <- vcov(ee) - testthat::expect_true(sum((VV[1:2,1:2] - V)^2) < 1e-12) - testthat::expect_true(sum((VV[3:4,3:4] - V)^2) < 1e-12) + testthat::expect_true(sum((VV[1:2,1:2] - V0)^2) < 1e-12) + testthat::expect_true(sum((VV[3:4,3:4] - V0)^2) < 1e-12) }) test_that("negative binomial regression (glm.nb)", {