From a77d0bc2365cf25023fad33a968504cdf2baaa1c Mon Sep 17 00:00:00 2001 From: Pannier Date: Wed, 10 Oct 2018 17:41:53 +0200 Subject: [PATCH] fixed bug due to changes in MuMIn package --- .Rprofile | 3 --- DESCRIPTION | 2 +- R/ebp.R | 5 ++++- R/summary.emdi.R | 12 ++++++------ man/direct.Rd | 4 ++-- man/map_plot.Rd | 5 +++-- man/write.excel.Rd | 4 ++-- 7 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 .Rprofile diff --git a/.Rprofile b/.Rprofile deleted file mode 100644 index 916dba48..00000000 --- a/.Rprofile +++ /dev/null @@ -1,3 +0,0 @@ -#### -- Packrat Autoloader (version 0.4.9-1) -- #### -source("packrat/init.R") -#### -- End Packrat Autoloader -- #### diff --git a/DESCRIPTION b/DESCRIPTION index cba99834..c614dc7e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,7 @@ License: GPL-2 URL: https://github.com/SoerenPannier/emdi LazyData: true Copyright: inst/COPYRIGHTS -RoxygenNote: 6.0.1 +RoxygenNote: 6.1.0 Imports: nlme, moments, diff --git a/R/ebp.R b/R/ebp.R index 25bd1ed2..cbe8ee93 100644 --- a/R/ebp.R +++ b/R/ebp.R @@ -172,7 +172,10 @@ ebp <- function(fixed, # Save function call --------------------------------------------------------- call <- match.call() - + if(inherits(call$fixed, "name")) + { + call$fixed <- fixed + } # Data manipulation and notational framework --------------------------------- if(!is.null(seed)) { if (cpus > 1 && parallel_mode != "socket") { diff --git a/R/summary.emdi.R b/R/summary.emdi.R index 2529d19c..d179daf6 100644 --- a/R/summary.emdi.R +++ b/R/summary.emdi.R @@ -143,19 +143,19 @@ summary.emdi <- function(object, ...) { Shapiro_p = c(shapiro_p_res, shapiro_p_ran), row.names = c("Error", "Random_effect") ) - - r_squared <- r.squaredGLMM(object$model) + tempMod <- object$model + tempMod$call$fixed <- object$fixed + r_squared <- r.squaredGLMM(tempMod) if (is.matrix(r_squared)) { - r_marginal <- r_squared["delta", 1] - r_conditional <- r_squared["delta", 2] + r_marginal <- r_squared[1, 1] + r_conditional <- r_squared[1, 2] } else { r_marginal <- r_squared[1] r_conditional <- r_squared[2] } icc_mixed <- icc(object$model) - coeff_det <- data.frame(#R2 = r_squared, - #ICC = icc_mixed, + coeff_det <- data.frame( Marginal_R2 = r_marginal, Conditional_R2 = r_conditional, row.names = "" diff --git a/man/direct.Rd b/man/direct.Rd index 3dec792d..a8b6f75f 100644 --- a/man/direct.Rd +++ b/man/direct.Rd @@ -6,8 +6,8 @@ \usage{ direct(y, smp_data, smp_domains, weights = NULL, design = NULL, threshold = NULL, var = FALSE, boot_type = "naive", B = 50, - seed = 123, X_calib = NULL, totals = NULL, custom_indicator = NULL, - na.rm = FALSE) + seed = 123, X_calib = NULL, totals = NULL, + custom_indicator = NULL, na.rm = FALSE) } \arguments{ \item{y}{a character string indicating the variable that is used for diff --git a/man/map_plot.Rd b/man/map_plot.Rd index a6a3115e..5fdd1e43 100644 --- a/man/map_plot.Rd +++ b/man/map_plot.Rd @@ -5,8 +5,9 @@ \title{Visualizes regional disaggregrated estimates on a map} \usage{ map_plot(object, indicator = "all", MSE = FALSE, CV = FALSE, - map_obj = NULL, map_dom_id = NULL, map_tab = NULL, color = c("white", - "red4"), scale_points = NULL, guide = "colourbar", return_data = FALSE) + map_obj = NULL, map_dom_id = NULL, map_tab = NULL, + color = c("white", "red4"), scale_points = NULL, + guide = "colourbar", return_data = FALSE) } \arguments{ \item{object}{an object of type emdi, containing the estimates to be diff --git a/man/write.excel.Rd b/man/write.excel.Rd index 4bf387f2..b0a5bc91 100644 --- a/man/write.excel.Rd +++ b/man/write.excel.Rd @@ -8,8 +8,8 @@ write.excel(object, file = "excel_output.xlsx", indicator = "all", MSE = FALSE, CV = FALSE, split = FALSE) -write.ods(object, file = "ods_output.ods", indicator = "all", MSE = FALSE, - CV = FALSE, split = FALSE) +write.ods(object, file = "ods_output.ods", indicator = "all", + MSE = FALSE, CV = FALSE, split = FALSE) } \arguments{ \item{object}{an object of type "emdi", representing point and