Commit e6b4198b authored by Andreas Tille's avatar Andreas Tille

New upstream version 2.6.2

parent 442efa08
......@@ -2,8 +2,8 @@ Package: sjPlot
Type: Package
Encoding: UTF-8
Title: Data Visualization for Statistics in Social Science
Version: 2.6.1
Date: 2018-10-14
Version: 2.6.2
Date: 2018-12-18
Authors@R: c(
person("Daniel", "Lüdecke", email = "d.luedecke@uke.de", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-8895-3206")),
person("Carsten", "Schwemmer", email = "carsten.schwemmer@uni-bamberg.de", role = "ctb")
......@@ -19,20 +19,20 @@ Description: Collection of plotting and table output functions for data
labelled data.
License: GPL-3
Depends: R (>= 3.2), graphics, grDevices, stats, utils
Imports: broom (>= 0.4.5), dplyr (>= 0.7.5), forcats, ggeffects (>=
0.6.0), glmmTMB, ggplot2 (>= 2.2.1), knitr, lme4 (>= 1.1-12),
magrittr, MASS, modelr, nlme, psych, purrr, rlang, scales,
sjlabelled (>= 1.0.14), sjmisc (>= 2.7.5), sjstats (>= 0.17.1),
tidyr (>= 0.7.0)
Suggests: AICcmodavg, brms, car, cluster, GPArotation, gridExtra,
ggrepel, ggridges, pscl, rstanarm, survey, TMB, Zelig, testthat
Imports: broom, dplyr (>= 0.7.5), forcats, ggeffects (>= 0.7.0),
glmmTMB, ggplot2 (>= 2.2.1), knitr, lme4 (>= 1.1-12), magrittr,
MASS, modelr, nlme, psych, purrr, rlang, scales, sjlabelled (>=
1.0.14), sjmisc (>= 2.7.6), sjstats (>= 0.17.2), tidyr (>=
0.7.0)
Suggests: brms, car, cluster, GPArotation, gridExtra, ggrepel,
ggridges, pscl, rstanarm, survey, TMB, Zelig, testthat
URL: https://strengejacke.github.io/sjPlot/
BugReports: https://github.com/strengejacke/sjPlot/issues
RoxygenNote: 6.1.0
RoxygenNote: 6.1.1
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2018-10-14 20:28:49 UTC; Daniel
Packaged: 2018-12-18 16:39:15 UTC; Daniel
Author: Daniel Lüdecke [aut, cre] (<https://orcid.org/0000-0002-8895-3206>),
Carsten Schwemmer [ctb]
Repository: CRAN
Date/Publication: 2018-10-14 21:50:03 UTC
Date/Publication: 2018-12-18 17:10:03 UTC
This diff is collapsed.
......@@ -60,11 +60,7 @@ export(sjplot)
export(sjplot_pal)
export(sjt.corr)
export(sjt.fa)
export(sjt.glm)
export(sjt.glmer)
export(sjt.itemanalysis)
export(sjt.lm)
export(sjt.lmer)
export(sjt.pca)
export(sjt.stackfrq)
export(sjt.xtab)
......@@ -85,7 +81,6 @@ importFrom(broom,tidy)
importFrom(dplyr,"%>%")
importFrom(dplyr,arrange)
importFrom(dplyr,between)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,filter)
......@@ -96,7 +91,6 @@ importFrom(dplyr,inner_join)
importFrom(dplyr,mutate)
importFrom(dplyr,n_distinct)
importFrom(dplyr,select)
importFrom(dplyr,select_)
importFrom(dplyr,slice)
importFrom(dplyr,summarise)
importFrom(dplyr,summarize)
......@@ -120,7 +114,6 @@ importFrom(graphics,plot)
importFrom(graphics,rect)
importFrom(knitr,asis_output)
importFrom(knitr,knit_print)
importFrom(lme4,VarCorr)
importFrom(lme4,getME)
importFrom(lme4,ranef)
importFrom(magrittr,"%>%")
......@@ -159,6 +152,7 @@ importFrom(sjlabelled,get_labels)
importFrom(sjlabelled,get_term_labels)
importFrom(sjlabelled,get_values)
importFrom(sjlabelled,set_labels)
importFrom(sjmisc,add_case)
importFrom(sjmisc,add_columns)
importFrom(sjmisc,add_variables)
importFrom(sjmisc,group_labels)
......@@ -176,19 +170,15 @@ importFrom(sjmisc,std)
importFrom(sjmisc,str_contains)
importFrom(sjmisc,str_start)
importFrom(sjmisc,to_factor)
importFrom(sjmisc,to_label)
importFrom(sjmisc,to_value)
importFrom(sjmisc,trim)
importFrom(sjmisc,var_rename)
importFrom(sjmisc,var_type)
importFrom(sjmisc,word_wrap)
importFrom(sjmisc,zap_inf)
importFrom(sjstats,chisq_gof)
importFrom(sjstats,cod)
importFrom(sjstats,cramer)
importFrom(sjstats,cronb)
importFrom(sjstats,hdi)
importFrom(sjstats,hoslem_gof)
importFrom(sjstats,icc)
importFrom(sjstats,mean_n)
importFrom(sjstats,mic)
......@@ -202,7 +192,6 @@ importFrom(sjstats,reliab_test)
importFrom(sjstats,resp_val)
importFrom(sjstats,resp_var)
importFrom(sjstats,robust)
importFrom(sjstats,se)
importFrom(sjstats,std_beta)
importFrom(sjstats,table_values)
importFrom(sjstats,typical_value)
......@@ -238,9 +227,7 @@ importFrom(stats,kmeans)
importFrom(stats,kruskal.test)
importFrom(stats,lm)
importFrom(stats,loess)
importFrom(stats,logLik)
importFrom(stats,mad)
importFrom(stats,model.frame)
importFrom(stats,na.omit)
importFrom(stats,na.pass)
importFrom(stats,nobs)
......@@ -261,7 +248,6 @@ importFrom(stats,quantile)
importFrom(stats,rect.hclust)
importFrom(stats,residuals)
importFrom(stats,rstudent)
importFrom(stats,runif)
importFrom(stats,sd)
importFrom(stats,shapiro.test)
importFrom(stats,summary.lm)
......
# sjPlot 2.6.2
## General
* Revised some help-files and vignettes.
## Removed / Defunct
Following functions are now defunct:
* `sjt.lm()`, `sjt.glm()`, `sjt.lmer()` and `sjt.glmer()`. Please use `tab_model()` instead.
## Changes to functions
* `tab_model()` supports printing simplex parameters of monotonic effects of **brms** models.
* `tab_model()` gets a `prefix.labels`-argument to add a prefix to the labels of categorical terms.
* The `rotation`-argument in `sjt.pca()` and `sjp.pca()` now supports all rotations from `psych::principal()`.
## Bug fixes
* `plot_model()` no longer automatically changes the plot-type to `"slope"` for models with only one predictor that is categorical and has more than two levels.
* `type = "eff"` and `type = "pred"` in `plot_model()` did not work when `terms` was not specified.
* If robust standard errors are requested in `tab_model()`, the confidence intervals and p-values are now re-calculated and adjusted based on the robust standard errors.
* `colors = "bw"` was not recognized correctly for `plot_model(..., type = "int")`.
* Fix issue in `sjp.frq()` with correct axis labels for non-labelled character vectors.
# sjPlot 2.6.1
## General
......
......@@ -183,6 +183,11 @@ pgrpmean <- function(x, ...) {
attr(x, "p.value", exact = TRUE)
)
enc <- attr(x, "encoding", exact = TRUE)
file <- attr(x, "file", exact = TRUE)
if (is.null(enc)) enc <- "UTF-8"
tab_df(
x = x,
title = title,
......@@ -192,12 +197,12 @@ pgrpmean <- function(x, ...) {
show.rownames = FALSE,
show.footnote = TRUE,
alternate.rows = FALSE,
encoding = "UTF-8",
encoding = enc,
CSS = list(
css.firsttablecol = '+text-align:left;',
css.lasttablerow = 'border-top:1px solid; border-bottom: double;'
),
file = NULL,
file = file,
use.viewer = attr(x, "print", exact = TRUE) == "viewer",
...
)
......@@ -207,6 +212,10 @@ pgrpmean <- function(x, ...) {
#' @importFrom purrr map_chr
pgrpmeans <- function(x, ...) {
uv <- attr(x, "print", exact = TRUE) == "viewer"
enc <- attr(x, "encoding", exact = TRUE)
file <- attr(x, "file", exact = TRUE)
if (is.null(enc)) enc <- "UTF-8"
titles <- purrr::map_chr(x, ~ sprintf(
"Mean for %s by %s<br><span class=\"subtitle\">grouped by %s</span>",
......@@ -233,12 +242,12 @@ pgrpmeans <- function(x, ...) {
show.rownames = FALSE,
show.footnote = TRUE,
alternate.rows = FALSE,
encoding = "UTF-8",
encoding = enc,
CSS = list(
css.firsttablecol = '+text-align:left;',
css.lasttablerow = 'border-top:1px solid; border-bottom: double;'
),
file = NULL,
file = file,
use.viewer = uv,
...
)
......@@ -274,6 +283,11 @@ pequi_test <- function(x, ...) {
}
enc <- attr(x, "encoding", exact = TRUE)
file <- attr(x, "file", exact = TRUE)
if (is.null(enc)) enc <- "UTF-8"
tab_df(
x = x,
title = "Test for Practical Equivalence of Model Parameters",
......@@ -283,13 +297,13 @@ pequi_test <- function(x, ...) {
show.rownames = FALSE,
show.footnote = TRUE,
alternate.rows = FALSE,
encoding = "UTF-8",
encoding = enc,
CSS = list(
css.firsttablecol = '+text-align:left;',
css.lasttablerow = 'border-bottom: 1px solid;',
css.col3 = '+text-align:right;'
),
file = NULL,
file = file,
use.viewer = attr(x, "print", exact = TRUE) == "viewer",
...
)
......@@ -303,6 +317,11 @@ preliab <- function(x, ...) {
"Item Discrimination"
)
enc <- attr(x, "encoding", exact = TRUE)
file <- attr(x, "file", exact = TRUE)
if (is.null(enc)) enc <- "UTF-8"
tab_df(
x = x,
title = "Reliability Test",
......@@ -312,12 +331,12 @@ preliab <- function(x, ...) {
show.rownames = FALSE,
show.footnote = FALSE,
alternate.rows = FALSE,
encoding = "UTF-8",
encoding = enc,
CSS = list(
css.firsttablecol = '+text-align:left;',
css.lasttablerow = 'border-bottom: 1px solid;'
),
file = NULL,
file = file,
use.viewer = attr(x, "print", exact = TRUE) == "viewer",
...
)
......@@ -334,6 +353,10 @@ pdescr <- function(x, ...) {
if ("digits" %in% names(add.args)) digits <- eval(add.args[["digits"]])
uv <- attr(x, "print", exact = TRUE) == "viewer"
enc <- attr(x, "encoding", exact = TRUE)
file <- attr(x, "file", exact = TRUE)
if (is.null(enc)) enc <- "UTF-8"
chead <- c(
"Variable",
......@@ -364,7 +387,7 @@ pdescr <- function(x, ...) {
show.rownames = FALSE,
show.footnote = FALSE,
alternate.rows = TRUE,
encoding = "UTF-8",
encoding = enc,
CSS = list(
css.firsttablecol = '+text-align:left;',
css.lasttablerow = 'border-bottom: 1px solid;',
......@@ -372,7 +395,7 @@ pdescr <- function(x, ...) {
css.col2 = '+text-align:left;',
css.col3 = '+text-align:left;'
),
file = NULL,
file = file,
use.viewer = uv,
...
)
......@@ -394,6 +417,10 @@ pgdescr <- function(x, ...) {
if ("digits" %in% names(add.args)) digits <- eval(add.args[["digits"]])
uv <- attr(x, "print", exact = TRUE) == "viewer"
enc <- attr(x, "encoding", exact = TRUE)
file <- attr(x, "file", exact = TRUE)
if (is.null(enc)) enc <- "UTF-8"
chead <- c(
"Variable",
......@@ -426,13 +453,13 @@ pgdescr <- function(x, ...) {
show.rownames = FALSE,
show.footnote = FALSE,
alternate.rows = TRUE,
encoding = "UTF-8",
encoding = enc,
CSS = list(
css.firsttablecol = '+text-align:left;',
css.lasttablerow = 'border-bottom: 1px solid;',
css.col3 = '+text-align:left;'
),
file = NULL,
file = file,
use.viewer = uv,
...
)
......@@ -443,7 +470,13 @@ pgdescr <- function(x, ...) {
#' @importFrom dplyr n_distinct select
#' @importFrom sjmisc is_empty
pfrq <- function(x, ...) {
uv <- attr(x, "print", exact = TRUE) == "viewer"
enc <- attr(x, "encoding", exact = TRUE)
file <- attr(x, "file", exact = TRUE)
if (is.null(enc)) enc <- "UTF-8"
titles <- purrr::map_chr(x, function(i) {
......@@ -497,7 +530,7 @@ pfrq <- function(x, ...) {
show.rownames = FALSE,
show.footnote = TRUE,
alternate.rows = FALSE,
encoding = "UTF-8",
encoding = enc,
CSS = list(
css.firsttablecol = '+text-align:left;',
css.lasttablerow = 'border-bottom: 1px solid;',
......@@ -507,7 +540,7 @@ pfrq <- function(x, ...) {
css.col5 = 'text-align: right;',
css.col6 = 'text-align: right;'
),
file = NULL,
file = file,
use.viewer = uv,
...
)
......@@ -552,6 +585,11 @@ pmwu <- function(x, ...) {
)
}
enc <- attr(x, "encoding", exact = TRUE)
file <- attr(x, "file", exact = TRUE)
if (is.null(enc)) enc <- "UTF-8"
tab_df(
x = x$tab.df,
......@@ -562,7 +600,8 @@ pmwu <- function(x, ...) {
show.type = FALSE,
show.footnote = !is.null(fn),
alternate.rows = TRUE,
file = NULL,
file = file,
encoding = enc,
CSS = list(
css.firsttablecol = '+text-align:left;',
css.lasttablerow = 'border-bottom: 1px solid;'
......
......@@ -29,42 +29,6 @@ get_dot_data <- function(data, dots) {
dot_names <- function(dots) unname(unlist(lapply(dots, as.character)))
#' @importFrom sjmisc str_contains to_label to_value replace_na word_wrap
#' @importFrom sjstats resp_val resp_var
get_lm_data <- function(fit) {
if (inherits(fit, "plm")) {
# plm objects have different structure than (g)lm
fit_x <- data.frame(cbind(as.vector(fit$model[, 1]), stats::model.matrix(fit)))
# retrieve response vector
resp <- sjstats::resp_val(fit)
depvar.label <- sjstats::resp_var(fit)
} else if (inherits(fit, "pggls")) {
# plm objects have different structure than (g)lm
fit_x <- data.frame(fit$model)
depvar.label <- attr(attr(attr(fit$model, "terms"), "dataClasses"), "names")[1]
# retrieve response vector
resp <- as.vector(fit$model[, 1])
} else if (is_merMod(fit)) {
fit_x <- data.frame(stats::model.matrix(fit))
# retrieve response vector
resp <- stats::model.frame(fit)[[1]]
depvar.label <- sjstats::resp_var(fit)
} else if (inherits(fit, "gls")) {
fit_x <- data.frame(stats::model.matrix(fit))
resp <- nlme::getResponse(fit)
depvar.label <- attr(resp, "label")
} else {
fit_x <- data.frame(stats::model.matrix(fit))
# retrieve response vector
resp <- stats::model.frame(fit)[[1]]
depvar.label <- sjstats::resp_var(fit)
}
# get variable label label
depvar.label <- unname(sjlabelled::get_label(x = resp, def.value = depvar.label))
return(list(matrix = fit_x, resp.label = depvar.label, resp = resp))
}
# add annotations with table summary
# here we print out total N of cases, chi-square and significance of the table
print.table.summary <- function(baseplot,
......@@ -452,181 +416,6 @@ crosstabsum <- function(x, grp, weight.by) {
}
# checks at which position in fitted models factors with
# more than two levels are located.
#' @importFrom stats model.frame
retrieveModelGroupIndices <- function(models, rem_rows = NULL) {
# init group-row-indices
group.pred.rows <- c()
group.pred.labs <- c()
group.pred.span <- c()
found.factors <- c()
add.index <- 0
# ------------------------
# retrieve fitted models
# ------------------------
# go through fitted models
for (k in seq_len(length(models))) {
# get model
fit <- models[[k]]
# copy model frame
if (is_merMod(fit))
fmodel <- stats::model.frame(fit, fixed.only = T)
else
fmodel <- stats::model.frame(fit)
# retrieve all factors from model
for (grp.cnt in seq_len(ncol(fmodel))) {
# get variable
fit.var <- fmodel[, grp.cnt]
# is factor? and has more than two levels?
# (otherwise, only one category would appear in
# coefficients, so no grouping needed anyway)
if (is.factor(fit.var) && nlevels(fit.var) > 2) {
# get factor name
fac.name <- colnames(fmodel)[grp.cnt]
# check whether we already have this factor
if (!any(found.factors == fac.name)) {
# if not, save found factor variable name
found.factors <- c(found.factors, fac.name)
# save factor name
lab <- unname(sjlabelled::get_label(fit.var, def.value = fac.name))
# determins startindex
index <- grp.cnt + add.index - 1
index.add <- nlevels(fit.var) - 2
# save row index, so we know where to start group
group.pred.rows <- c(group.pred.rows, index)
group.pred.span <- c(group.pred.span, index:(index + index.add))
group.pred.labs <- c(group.pred.labs, lab)
# increase add.index by amount of factor levels (minus reference cat.)
add.index <- add.index + index.add
} else {
add.index <- add.index + nlevels(fit.var) - 2
}
}
}
}
# have any groups? if not, reset row-index-counter
if (length(group.pred.rows) < 1) {
group.pred.rows <- NULL
group.pred.labs <- NULL
group.pred.span <- NULL
}
# do we have any rows removed?
else if (!is.null(rem_rows)) {
# any non-computed row-indices left?
while (length(rem_rows) > 0) {
# take care, while loop!
any.found <- FALSE
# if yes, go through all grouping row indices
for (i in seq_len(length(group.pred.rows))) {
# if yes, check if removed row was before
# grouped row indes
if (length(rem_rows) > 0 && rem_rows[1] <= group.pred.rows[i]) {
# if yes, iterate all remaining group indices
for (j in i:length(group.pred.rows)) {
# and reduce index number (because of removed rows)
group.pred.rows[j] <- group.pred.rows[j] - 1
}
# where does span for grouping start?
start <- min(which(group.pred.span >= rem_rows[1]))
for (j in start:length(group.pred.span)) {
# and reduce index number (because of removed rows)
group.pred.span[j] <- group.pred.span[j] - 1
}
# reduce indices
rem_rows <- rem_rows - 1
# remove computed row-index
rem_rows <- rem_rows[-1]
# found something!
any.found <- TRUE
}
}
# removed any index? if not, break loop
if (!any.found) break
}
}
return(list(group.pred.rows,
group.pred.span,
group.pred.labs))
}
# automatically retrieve predictor labels
# of fitted (g)lm
#' @importFrom stats formula terms
retrieveModelLabels <- function(models, group.pred) {
fit.labels <- c()
for (k in seq_len(length(models))) {
# get model
fit <- models[[k]]
# any valid model?
if (inherits(fit, c("plm", "ppgls"))) return(NULL)
# get model coefficients' names
if (is_merMod(fit)) {
coef_names <- names(lme4::fixef(fit))
# get model frame
m_f <- stats::model.frame(fit, fixed.only = TRUE)
} else {
coef_names <- names(stats::coef(fit))
# get model frame
m_f <- stats::model.frame(fit)
}
# for NULL-models, we just have one column in model frame
if (ncol(m_f) > 1) {
# iterate coefficients (1 is intercept or response)
for (i in 2:ncol(m_f)) {
# check bounds
if (i <= length(coef_names)) {
# get predictor
pvar <- m_f[, i]
# check if we have a variable label
lab <- sjlabelled::get_label(pvar, def.value = colnames(m_f)[i])
# get model coefficients' names
coef_name <- coef_names[i]
# is predictor a factor?
# if yes, we have this variable multiple
# times, so manually set value labels
if (is.factor(pvar)) {
# get amount of levels
pvar.len <- nlevels(pvar)
# get value labels, if any
pvar.lab <- sjlabelled::get_labels(pvar)
# have any labels, and have we same amount of labels
# as factor levels?
if (!is.null(pvar.lab) && length(pvar.lab) == pvar.len) {
# create labels
if (group.pred && pvar.len > 2) {
# if predictor grouping is enabled, don't use variable labels again
labels.to.add <- pvar.lab[2:pvar.len]
} else {
# else, if we have not grouped predictors, we have no headin
# with variable label, hence, factor levels may not be intuitiv.
# thus, add variable label so values have a meaning
labels.to.add <- sprintf("%s (%s)", lab, pvar.lab[2:pvar.len])
}
fit.labels <- c(fit.labels, labels.to.add)
} else {
fit.labels <- c(fit.labels, coef_name)
}
} else {
if (!any(fit.labels == lab)) fit.labels <- c(fit.labels, lab)
}
}
}
}
}
unique(fit.labels)
}
# compute chi-square for glm
Chisquare.glm <- function(rr, digits = 3) {
return(with(rr, pchisq(null.deviance - deviance,
df.null - df.residual,
lower.tail = FALSE), digits = digits))
}
# Erzeugt eine rotierte Faktorladungen einer Hauptkomponentenanalyse
# (Paramter "data") mit einer bestimmten Anzahl an Faktoren (Parameter "factors")
# auf Grundlage der Varimax-Rotation
......
......@@ -277,6 +277,15 @@ tab_model_df <- function(x,
# get style definition
style <- tab_df_style(CSS = CSS, ...)
# check for monotonic effects
sp <- string_starts_with("simo_mo", x$term)
if (!sjmisc::is_empty(sp)) {
x.sp <- dplyr::slice(x, !! sp)
x <- dplyr::slice(x, -!! sp)
x$term <- gsub(pattern = "^bsp_mo", replacement = "", x = x$term)
} else
x.sp <- NULL
# get HTML content
page.content <- tab_df_content(
......@@ -341,6 +350,40 @@ tab_model_df <- function(x,
page.content <- paste0(dv.content, page.content)
# simplex parameters here ----
if (!is.null(x.sp)) {
x.sp$term <- gsub(
pattern = "^simo_mo(.*)(\\.)(.*)(\\.)",
replacement = "\\1 \\[\\3\\]",
x = x.sp$term
)
sp.content <- tab_df_content(
mydf = x.sp,
title = NULL,
footnote = NULL,
col.header = NULL,
show.type = FALSE,
show.rownames = FALSE,
show.footnote = FALSE,
show.header = FALSE,
altr.row.col = FALSE,
sort.column = NULL,
include.table.tag = FALSE,
no.last.table.row = TRUE,
...
)
page.content <- paste0(page.content, " <tr>\n")
page.content <- paste0(page.content, sprintf(" <td colspan=\"%i\" class=\"simplexparts\">Simplex Parameters</td>\n", ncol(x)))
page.content <- paste0(page.content, " </tr>\n")
page.content <- paste0(page.content, sp.content)
}
# zero inflation part here ----
if (!is.null(zeroinf)) {
......@@ -508,6 +551,8 @@ tab_model_df <- function(x,
}
## TODO also show conditional ICC
if (!is_empty_list(icc.adj.list) && show.adj.icc) {
# icc.len <- max(purrr::map_dbl(icc.adj.list, length))
......
......@@ -260,6 +260,7 @@ tab_df_prepare_style <- function(CSS = NULL, content = NULL, task, ...) {
tag.fixedparts <- "fixedparts"
tag.randomparts <- "randomparts"
tag.zeroparts <- "zeroparts"
tag.simplexparts <- "simplexparts"
tag.firstsumrow <- "firstsumrow"
tag.labelcellborder <- "labelcellborder"
tag.depvarhead <- "depvarhead"
......@@ -295,6 +296,7 @@ tab_df_prepare_style <- function(CSS = NULL, content = NULL, task, ...) {
css.fixedparts <- "font-weight:bold; text-align:left;"
css.randomparts <- "font-weight:bold; text-align:left; padding-top:.8em;"
css.zeroparts <- "font-weight:bold; text-align:left; padding-top:.8em;"
css.simplexparts <- "font-weight:bold; text-align:left; padding-top:.8em;"
css.firstsumrow <- "border-top:1px solid;"
css.labelcellborder <- "border-bottom:1px solid;"
css.depvarhead <- "text-align:center; border-bottom:1px solid; font-style:italic; font-weight:normal;"
......@@ -339,6 +341,7 @@ tab_df_prepare_style <- function(CSS = NULL, content = NULL, task, ...) {
if (!is.null(CSS[['css.fixedparts']])) css.fixedparts <- ifelse(substring(CSS[['css.fixedparts']], 1, 1) == '+', paste0(css.fixedparts, substring(CSS[['css.fixedparts']], 2)), CSS[['css.fixedparts']])
if (!is.null(CSS[['css.randomparts']])) css.randomparts <- ifelse(substring(CSS[['css.randomparts']], 1, 1) == '+', paste0(css.randomparts, substring(CSS[['css.randomparts']], 2)), CSS[['css.randomparts']])
if (!is.null(CSS[['css.zeroparts']])) css.zeroparts <- ifelse(substring(CSS[['css.zeroparts']], 1, 1) == '+', paste0(css.zeroparts, substring(CSS[['css.zeroparts']], 2)), CSS[['css.zeroparts']])
if (!is.null(CSS[['css.simplexparts']])) css.simplexparts <- ifelse(substring(CSS[['css.simplexparts']], 1, 1) == '+', paste0(css.simplexparts, substring(CSS[['css.simplexparts']], 2)), CSS[['css.simplexparts']])
if (!is.null(CSS[['css.firstsumrow']])) css.firstsumrow <- ifelse(substring(CSS[['css.firstsumrow']], 1, 1) == '+', paste0(css.firstsumrow, substring(CSS[['css.firstsumrow']], 2)), CSS[['css.firstsumrow']])
if (!is.null(CSS[['css.labelcellborder']])) css.labelcellborder <- ifelse(substring(CSS[['css.labelcellborder']], 1, 1) == '+', paste0(css.table, substring(CSS[['css.labelcellborder']], 2)), CSS[['css.labelcellborder']])
if (!is.null(CSS[['css.depvarhead']])) css.depvarhead <- ifelse(substring(CSS[['css.depvarhead']], 1, 1) == '+', paste0(css.depvarhead, substring(CSS[['css.depvarhead']], 2)), CSS[['css.depvarhead']])
......@@ -356,7 +359,7 @@ tab_df_prepare_style <- function(CSS = NULL, content = NULL, task, ...) {
if (task == 1) {
content <- sprintf(
"<style>\nhtml, body { background-color: white; }\n%s { %s }\n%s { %s }\n%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n</style>",
"<style>\nhtml, body { background-color: white; }\n%s { %s }\n%s { %s }\n%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n.%s { %s }\n</style>",
tag.table, css.table,
tag.caption, css.caption,
tag.td, css.td,
......@@ -368,6 +371,7 @@ tab_df_prepare_style <- function(CSS = NULL, content = NULL, task, ...) {
tag.fixedparts, css.fixedparts,
tag.randomparts, css.randomparts,
tag.zeroparts, css.zeroparts,
tag.simplexparts, css.simplexparts,
tag.lasttablerow, css.lasttablerow,
tag.firsttablerow, css.firsttablerow,
tag.firstsumrow, css.firstsumrow,
......
......@@ -34,11 +34,11 @@
#' \describe{
#' \item{\code{type = "slope"}}{Slope of coefficients for each single
#' predictor, against the response (linear relationship between each model
#' term and response).}