Commit 622666e4 authored by Andreas Tille's avatar Andreas Tille

New upstream version 2.4.1

parents
Package: sjPlot
Type: Package
Encoding: UTF-8
Title: Data Visualization for Statistics in Social Science
Version: 2.4.1
Date: 2018-02-05
Authors@R: c(
person("Daniel", "Lüdecke", email = "d.luedecke@uke.de", role = c("aut", "cre")),
person("Carsten", "Schwemmer", email = "carsten.schwemmer@uni-bamberg.de", role = "ctb")
)
Maintainer: Daniel Lüdecke <d.luedecke@uke.de>
Description: Collection of plotting and table output functions for data
visualization. Results of various statistical analyses (that are commonly used
in social sciences) can be visualized using this package, including simple and
cross tabulated frequencies, histograms, box plots, (generalized) linear models,
mixed effects models, principal component analysis and correlation matrices,
cluster analyses, scatter plots, stacked scales, effects plots of regression
models (including interaction terms) and much more. This package supports
labelled data.
License: GPL-3
Depends: R (>= 3.2), graphics, grDevices, stats, utils
Imports: arm, broom (>= 0.4.2), dplyr (>= 0.7.1), effects, forcats,
ggeffects (>= 0.3.1), glmmTMB, ggplot2 (>= 2.2.1), knitr, lme4
(>= 1.1-12), magrittr, MASS, merTools (>= 0.3.0), modelr, nlme,
psych, purrr, rlang, scales, sjlabelled (>= 1.0.7), sjmisc (>=
2.6.3), sjstats (>= 0.14.0), tidyselect, tibble (>= 1.3.3),
tidyr (>= 0.7.0)
Suggests: AICcmodavg, car, cluster, GPArotation, gridExtra, ggrepel,
ggridges, lmerTest, lmtest, rstanarm, survey, viridis,
wesanderson, Zelig
URL: https://github.com/strengejacke/sjPlot
BugReports: https://github.com/strengejacke/sjPlot/issues
RoxygenNote: 6.0.1
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2018-02-05 16:45:04 UTC; Daniel
Author: Daniel Lüdecke [aut, cre],
Carsten Schwemmer [ctb]
Repository: CRAN
Date/Publication: 2018-02-05 16:57:18 UTC
b24ffd140d56adead3511c4cc73111e3 *DESCRIPTION
7b87dcba9321eca174578dbbd1a0169d *NAMESPACE
1ba990c612ce12cd425da35f1c65cc0d *NEWS.md
49b853ea7c4d30cc29a6c0250a31b37c *R/S3-methods.R
6abe9585c51714a79dcf309711c87425 *R/color_utils.R
85f55a306efb3c0df9f3ef61c162fb8e *R/helpfunctions.R
4886fe43ec579e652cfbf40b1329335f *R/html_print.R
2c8cffeb573ace08af52f10dfb8e223d *R/plot_diag_linear.R
0d641ad343766d709d3c8b80739c8d1c *R/plot_diag_stan.R
d1b1a81a8bc58b389f3812088ec091a4 *R/plot_grid.R
b1e6731691c31cd957dc48349af1f60c *R/plot_model.R
a02a2fbb3ab01be892d933fe4ad77556 *R/plot_model_estimates.R
d1c12333382daab2f1d7101885477c3c *R/plot_models.R
17e168581c632d6aa3edd5bf35dc9b41 *R/plot_point_estimates.R
fb59e0c5766a18a6a43976c232901f71 *R/plot_type_eff.R
f9b6f1249f97ab790da4087f364f8992 *R/plot_type_est.R
c033237f7c62940f108045f1a78b4a03 *R/plot_type_int.R
4e183e593b45b31efd3afafbac97fd15 *R/plot_type_ranef.R
b6278077529641a6b937b75cdfa0013c *R/plot_type_slope.R
f6f3bfd27e5ba7ab003a9b2b4c8cf587 *R/save_plot.R
779e8fe85a52ac7cba36cd73d21bc0c8 *R/sjPlotAnova.R
135e3ecebb4867f203cbb9eb9254d73e *R/sjPlotClusterAnalysis.R
a5a73f078f558b19b5384390e0305d2b *R/sjPlotCorr.R
4f783f6983d2a62c884e6c4a31f022ca *R/sjPlotDist.R
4226d1d558516202b7b7fd46487a8c41 *R/sjPlotFA.R
3c8aada0dc65dc6d934aa79fd66a3785 *R/sjPlotFrequencies.R
bcd074748c921a89b2947b9ffa7a123e *R/sjPlotGLME.R
abcae80a621017b9dce6cb0fa4dac695 *R/sjPlotGroupFrequencies.R
a6a591cc98caf7dc9d3534aeee10637f *R/sjPlotGroupPropTable.R
94a56478d0c5ae388603d65c07fe1d12 *R/sjPlotInteractions.R
febd3bd05174651c932e968579f28f5f *R/sjPlotKfoldCV.R
933822d52336ebac7efeddb11c888229 *R/sjPlotLikert.R
1a171611427f9e65b95d848b075471ee *R/sjPlotLinreg.R
ec5a37329fb1f10be1f64c6486804e8a *R/sjPlotOdds.R
3d83499b9c50e6097c8ee860340d087b *R/sjPlotPCA.R
a65564e542a49c5860f40f21b6fedb00 *R/sjPlotPearsonsChi2Test.R
f0fe5671ebe682c3e207ee9726aff9de *R/sjPlotPolynomials.R
53325676c741516dbabde8a318584560 *R/sjPlotPropTable.R
a5cd7402155b59f8b446568f221961b8 *R/sjPlotResiduals.R
2bb8a2b60e8975f00f38733a1e5a81a6 *R/sjPlotScatter.R
1d91d6830348ec299ebcd7033712e176 *R/sjPlotSetTheme.R
06b7b79f1a8dd5afc283a2ff5f58c7c9 *R/sjPlotStackFrequencies.R
c7cafbe91cfb9dfa680ee02bb67b3fc3 *R/sjTabCorr.R
5e685346fc7b4bbb9ae38495a8e5683c *R/sjTabFA.R
5a93f771b6647e6f3a8131b9914dce57 *R/sjTabFrequencies.R
b2d8010a1683af22af617b37d32dce18 *R/sjTabGrpmean.R
a5a54d06d021d9dc91eb73f7deafee65 *R/sjTabItemAnalysis.R
c1e182b91a7423ceba71b882a33a66af *R/sjTabLinReg.R
9149fac1e62107ea684e47af17776e73 *R/sjTabOdds.R
9a94bbb938286ba309eefe95c8f45890 *R/sjTabPCA.R
74d688e76763fc83e47feee720a37a19 *R/sjTabPropTable.R
3a41e0f6707a02e3d4dbc4d847ad1937 *R/sjTabSPSS.R
508457d45585768a2c42bbd26141a646 *R/sjTabStackFrq.R
2d7a63fd619f154e36eeb80095113df4 *R/sjplot.R
d4541e9cebccb52bcd150f755a7d7029 *R/sjplot_themes.R
bf47d470e3c8b5b374999711801dd23f *R/table_functions.R
dd53c33982578980d50a4c7c8401a1af *R/tidiers.R
4648daf6b895b7fa12d6f6fbce7c2f71 *R/utils.R
1daa37a431ec0d0accbcada80d7f35ef *R/zzz.R
60990496ac8180f9ccf681f3d464c820 *README.md
2198742a2bb752d8293064351fd245d4 *build/partial.rdb
17f9e34bee65d033752f2a992895e486 *build/vignette.rds
3172b22b3d87d0f86d78326bc26891fc *data/efc.RData
964feaeebd30942263c7f847614e1bc3 *inst/CITATION
a0103e4e9b05710bff794b354e9741e7 *inst/doc/blackwhitefigures.R
28ba3895d0feb2f5d16896ecb66da66c *inst/doc/blackwhitefigures.Rmd
f19f4dff29a95c574146b0e533758d84 *inst/doc/blackwhitefigures.html
5f6bb2f21afcfddb8688a5768ad936ce *inst/doc/custplot.R
7e85dd5c766d10399e25e70705d309e0 *inst/doc/custplot.Rmd
8fe4fac26c145d856b9a98a82cde90cd *inst/doc/custplot.html
24a8f87fa48e92a47c4909bf01ac25c4 *inst/doc/plot_interactions.R
53fc0ddad748e3c891f09b5902065a7e *inst/doc/plot_interactions.Rmd
5cba2b1eb9f48b53f67b4a17eca0dbfa *inst/doc/plot_interactions.html
fdb64a55bcd3c895650791b9f01f658c *inst/doc/plot_marginal_effects.R
66c733b346684e296f0600d56ae85d8f *inst/doc/plot_marginal_effects.Rmd
e4865b327169c449643bd79a59fb23d3 *inst/doc/plot_marginal_effects.html
170550f4ffb011c1a294d44db51db06c *inst/doc/plot_model_estimates.R
aed513bd83556b74f92dfe27bd1a51ed *inst/doc/plot_model_estimates.Rmd
b874846647e0a463a0df212867184366 *inst/doc/plot_model_estimates.html
6f0670d0932897a16959e76ad9317ecb *inst/doc/sjtbasic.R
fb306d9e88830c3045faa3476f803414 *inst/doc/sjtbasic.Rmd
31603e2cd1c370d55a95bf389e20a524 *inst/doc/sjtbasic.html
fcdab41d750f5c69054f6ac374ac6eaf *inst/doc/sjtitemanalysis.R
8deda82129fff87e439e4bbf69d7ee35 *inst/doc/sjtitemanalysis.Rmd
e707a97a4b44e065473b1e042d8f17c8 *inst/doc/sjtitemanalysis.html
dda733d63bdc7171f0abc34a689b0674 *inst/doc/sjtlm.R
0ffa04e6f5227b7eab667ad4608640b7 *inst/doc/sjtlm.Rmd
1e46e67def7635b1bb63b1f2d26e5ffc *inst/doc/sjtlm.html
403e43c14c40b38ae404b55a4ca3d80d *inst/doc/sjtlmer.R
b3bb6bd9f8394661413206cd898ed1a6 *inst/doc/sjtlmer.Rmd
206205ad5b1c0591e3f07362767a3797 *inst/doc/sjtlmer.html
27530b1ef1a43c5594ceb67ad35b1f8c *man/dist_chisq.Rd
7406e8e0a92f895c55a8d6d6c37b3d9c *man/dist_f.Rd
e57530cb5d67ca496117f3c9c0814e1c *man/dist_norm.Rd
bfa5882201124fe6946a818119ff08b1 *man/dist_t.Rd
a266bdb43b55140bc7146a2dee5290ff *man/efc.Rd
30519380b57b8139720feca91b45f558 *man/figures/logo.png
80c64e8f33128db04b651566cbf0606d *man/plot_grid.Rd
e777b704add495efdb87c480fa416bc9 *man/plot_model.Rd
4ac9b80ed385cf16c0b7e66b64a66a27 *man/plot_models.Rd
1e3685a79a382ae02b152282ce6806a5 *man/reexports.Rd
0c9fb562489e46391c383b093c50cb8d *man/save_plot.Rd
516c78a7b4e098abbe2d6e0e64f33d1c *man/set_theme.Rd
9e6007df517f80c12dc9b4090a0730ee *man/sjPlot-package.Rd
fe380979eabfa1fad569ddb44668b6f0 *man/sjPlot-themes.Rd
233110654f3542232e0b9d8c725f5e7a *man/sjc.cluster.Rd
41306f7ae2b2f02fb2663229dcc3e1cf *man/sjc.dend.Rd
b78b0ecb50bfa8744727dd226f2693ed *man/sjc.elbow.Rd
30863d61ea71ebf0f85c8ce7ed05dfbd *man/sjc.grpdisc.Rd
ac9104d183564dd6fba76d30915fd28c *man/sjc.kgap.Rd
f260ec0c63e675eabfab76fd21458298 *man/sjc.qclus.Rd
0981594f63f56d1e52122e32618f02c9 *man/sjp.aov1.Rd
7f3cbd73873a3f999e7b2b79d196d3b2 *man/sjp.chi2.Rd
73abc772180087e26cb4ca8483586dee *man/sjp.corr.Rd
749fdd5351ed5a08664bb0931bcad3cc *man/sjp.fa.Rd
6e8be2f9b138a0a3b2c30385426684f6 *man/sjp.frq.Rd
f2abd9d24dea00dc7c1a3575e50be8b9 *man/sjp.glm.Rd
78b2f715655a1472922578b8471a9f1d *man/sjp.glmer.Rd
72e10c97300b663af7568381acd7b803 *man/sjp.gpt.Rd
296b08dc47a12b2e3ea08e93e6fc27db *man/sjp.grpfrq.Rd
16bc07510302e9740fb9932f59ac260e *man/sjp.int.Rd
c6be38cffea6bd3280d8087b6121374d *man/sjp.kfold_cv.Rd
03f38abd70b6ceb536c5303193f67ea8 *man/sjp.likert.Rd
d59e564606e119af0f14ca100e13e17e *man/sjp.lm.Rd
c3d2e9c61bedbe240de2a61c483219e4 *man/sjp.lmer.Rd
68413ef2468e7d82a1457eefd8b57c05 *man/sjp.pca.Rd
0ca8f1287fc112b2cf9ec5039eae8936 *man/sjp.poly.Rd
a0abf9f67798d67701a53284d8a2cba8 *man/sjp.resid.Rd
a9a2776278d2bb23fda2a9bcc705173e *man/sjp.scatter.Rd
f7912e3743dc6f99cd8c556508b11c25 *man/sjp.stackfrq.Rd
7e3b69d423b599384c33e683638c4631 *man/sjp.xtab.Rd
7954f0b94701eb82c0a5f7ae44da182b *man/sjplot.Rd
2fb35fa39ace2ff3b6ade8035f24d9fa *man/sjt.corr.Rd
bf21e78adc715ca833b8f458fe6fab6f *man/sjt.fa.Rd
2dd2771c190507e4843a0ecd3ef14abf *man/sjt.frq.Rd
2165b146513f1a5513c93d77f74f1015 *man/sjt.glm.Rd
c5581bad09e57fb7e2923894f6b488fa *man/sjt.glmer.Rd
e79966a64fb7a495be98d7b19d81bdcf *man/sjt.grpmean.Rd
d4919f1bc71b3fd27540cb96d9c5a5a5 *man/sjt.itemanalysis.Rd
4d810a954d33c496d85ae221e20842d5 *man/sjt.lm.Rd
5c5d2d10ded75be19995d973f2e36cf5 *man/sjt.lmer.Rd
259ee78d43a41921a93f050c7bd3b547 *man/sjt.pca.Rd
c64cc7a5404feccac7f5fd9b89aba666 *man/sjt.stackfrq.Rd
e52df44d31c7133d2d0630171a77f3ee *man/sjt.xtab.Rd
ae33a69f5f631f168c92add392041d44 *man/tab_df.Rd
3f8246115895da4175c993729a839420 *man/view_df.Rd
28ba3895d0feb2f5d16896ecb66da66c *vignettes/blackwhitefigures.Rmd
7e85dd5c766d10399e25e70705d309e0 *vignettes/custplot.Rmd
53fc0ddad748e3c891f09b5902065a7e *vignettes/plot_interactions.Rmd
66c733b346684e296f0600d56ae85d8f *vignettes/plot_marginal_effects.Rmd
aed513bd83556b74f92dfe27bd1a51ed *vignettes/plot_model_estimates.Rmd
fb306d9e88830c3045faa3476f803414 *vignettes/sjtbasic.Rmd
8deda82129fff87e439e4bbf69d7ee35 *vignettes/sjtitemanalysis.Rmd
0ffa04e6f5227b7eab667ad4608640b7 *vignettes/sjtlm.Rmd
b3bb6bd9f8394661413206cd898ed1a6 *vignettes/sjtlmer.Rmd
# Generated by roxygen2: do not edit by hand
S3method(knit_print,sjTable)
S3method(print,sjTable)
S3method(print,sjt_descr)
S3method(print,sjt_frq)
S3method(print,sjt_grpdescr)
S3method(print,sjt_grpmean)
S3method(print,sjt_grpmeans)
S3method(print,sjt_mwu)
S3method(print,sjt_reliab)
export("%>%")
export(dist_chisq)
export(dist_f)
export(dist_norm)
export(dist_t)
export(font_size)
export(get_model_data)
export(label_angle)
export(legend_style)
export(plot_grid)
export(plot_model)
export(plot_models)
export(save_plot)
export(set_theme)
export(sjc.cluster)
export(sjc.dend)
export(sjc.elbow)
export(sjc.grpdisc)
export(sjc.kgap)
export(sjc.qclus)
export(sjp.aov1)
export(sjp.chi2)
export(sjp.corr)
export(sjp.fa)
export(sjp.frq)
export(sjp.glm)
export(sjp.glmer)
export(sjp.gpt)
export(sjp.grpfrq)
export(sjp.int)
export(sjp.kfold_cv)
export(sjp.likert)
export(sjp.lm)
export(sjp.lmer)
export(sjp.pca)
export(sjp.poly)
export(sjp.resid)
export(sjp.scatter)
export(sjp.stackfrq)
export(sjp.xtab)
export(sjplot)
export(sjt.corr)
export(sjt.df)
export(sjt.fa)
export(sjt.frq)
export(sjt.glm)
export(sjt.glmer)
export(sjt.grpmean)
export(sjt.itemanalysis)
export(sjt.lm)
export(sjt.lmer)
export(sjt.mwu)
export(sjt.pca)
export(sjt.stackfrq)
export(sjt.xtab)
export(sjtab)
export(tab_df)
export(tab_dfs)
export(theme_538)
export(theme_blank)
export(theme_sjplot)
export(theme_sjplot2)
export(view_df)
import(ggplot2)
importFrom(MASS,glm.nb)
importFrom(MASS,lda)
importFrom(arm,se.ranef)
importFrom(broom,augment)
importFrom(broom,tidy)
importFrom(dplyr,"%>%")
importFrom(dplyr,arrange)
importFrom(dplyr,arrange_)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,filter)
importFrom(dplyr,full_join)
importFrom(dplyr,group_by)
importFrom(dplyr,group_by_)
importFrom(dplyr,if_else)
importFrom(dplyr,mutate)
importFrom(dplyr,n_distinct)
importFrom(dplyr,rename_)
importFrom(dplyr,sample_n)
importFrom(dplyr,select)
importFrom(dplyr,select_)
importFrom(dplyr,slice)
importFrom(dplyr,summarise)
importFrom(dplyr,summarize)
importFrom(dplyr,ungroup)
importFrom(effects,allEffects)
importFrom(effects,effect)
importFrom(forcats,fct_reorder)
importFrom(forcats,fct_rev)
importFrom(ggeffects,ggeffect)
importFrom(ggeffects,ggpredict)
importFrom(glmmTMB,fixef)
importFrom(grDevices,axisTicks)
importFrom(grDevices,cm)
importFrom(grDevices,dev.off)
importFrom(grDevices,jpeg)
importFrom(grDevices,png)
importFrom(grDevices,rgb)
importFrom(grDevices,svg)
importFrom(grDevices,tiff)
importFrom(graphics,abline)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(graphics,rect)
importFrom(graphics,text)
importFrom(knitr,asis_output)
importFrom(knitr,knit_print)
importFrom(lme4,VarCorr)
importFrom(lme4,confint.merMod)
importFrom(lme4,fixef)
importFrom(lme4,getME)
importFrom(lme4,ranef)
importFrom(magrittr,"%>%")
importFrom(merTools,predictInterval)
importFrom(modelr,crossv_kfold)
importFrom(nlme,getCovariateFormula)
importFrom(nlme,getData)
importFrom(nlme,getResponse)
importFrom(nlme,intervals)
importFrom(psych,KMO)
importFrom(psych,describe)
importFrom(psych,fa)
importFrom(psych,fa.parallel)
importFrom(psych,principal)
importFrom(purrr,flatten_chr)
importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map2_df)
importFrom(purrr,map_chr)
importFrom(purrr,map_dbl)
importFrom(purrr,map_df)
importFrom(purrr,map_if)
importFrom(purrr,map_lgl)
importFrom(purrr,pmap)
importFrom(rlang,.data)
importFrom(scales,brewer_pal)
importFrom(scales,grey_pal)
importFrom(scales,percent)
importFrom(sjlabelled,as_numeric)
importFrom(sjlabelled,copy_labels)
importFrom(sjlabelled,get_dv_labels)
importFrom(sjlabelled,get_label)
importFrom(sjlabelled,get_labels)
importFrom(sjlabelled,get_note)
importFrom(sjlabelled,get_term_labels)
importFrom(sjlabelled,get_values)
importFrom(sjlabelled,set_labels)
importFrom(sjmisc,add_columns)
importFrom(sjmisc,group_labels)
importFrom(sjmisc,group_str)
importFrom(sjmisc,group_var)
importFrom(sjmisc,is_empty)
importFrom(sjmisc,is_even)
importFrom(sjmisc,is_float)
importFrom(sjmisc,is_num_fac)
importFrom(sjmisc,is_odd)
importFrom(sjmisc,rec)
importFrom(sjmisc,remove_var)
importFrom(sjmisc,replace_na)
importFrom(sjmisc,set_na)
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)
importFrom(sjstats,model_frame)
importFrom(sjstats,outliers)
importFrom(sjstats,p_value)
importFrom(sjstats,phi)
importFrom(sjstats,pred_vars)
importFrom(sjstats,r2)
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)
importFrom(sjstats,weight)
importFrom(sjstats,weight2)
importFrom(sjstats,wtd_sd)
importFrom(sjstats,xtab_statistics)
importFrom(stats,AIC)
importFrom(stats,anova)
importFrom(stats,aov)
importFrom(stats,as.formula)
importFrom(stats,binomial)
importFrom(stats,chisq.test)
importFrom(stats,coef)
importFrom(stats,complete.cases)
importFrom(stats,confint)
importFrom(stats,cor)
importFrom(stats,cor.test)
importFrom(stats,cov2cor)
importFrom(stats,cutree)
importFrom(stats,dchisq)
importFrom(stats,deviance)
importFrom(stats,df)
importFrom(stats,dist)
importFrom(stats,dnorm)
importFrom(stats,dt)
importFrom(stats,family)
importFrom(stats,fisher.test)
importFrom(stats,fitted)
importFrom(stats,formula)
importFrom(stats,ftable)
importFrom(stats,glm)
importFrom(stats,hclust)
importFrom(stats,kmeans)
importFrom(stats,kruskal.test)
importFrom(stats,lm)
importFrom(stats,loess)
importFrom(stats,logLik)
importFrom(stats,median)
importFrom(stats,model.frame)
importFrom(stats,model.matrix)
importFrom(stats,na.omit)
importFrom(stats,na.pass)
importFrom(stats,nobs)
importFrom(stats,pchisq)
importFrom(stats,pf)
importFrom(stats,pnorm)
importFrom(stats,poisson)
importFrom(stats,poly)
importFrom(stats,ppoints)
importFrom(stats,prcomp)
importFrom(stats,predict)
importFrom(stats,predict.glm)
importFrom(stats,pt)
importFrom(stats,qchisq)
importFrom(stats,qf)
importFrom(stats,qnorm)
importFrom(stats,qqline)
importFrom(stats,qqnorm)
importFrom(stats,qt)
importFrom(stats,quantile)
importFrom(stats,rect.hclust)
importFrom(stats,reorder)
importFrom(stats,residuals)
importFrom(stats,rstudent)
importFrom(stats,runif)
importFrom(stats,sd)
importFrom(stats,shapiro.test)
importFrom(stats,summary.lm)
importFrom(stats,terms)
importFrom(stats,update)
importFrom(stats,varimax)
importFrom(stats,vcov)
importFrom(stats,weighted.mean)
importFrom(stats,wilcox.test)
importFrom(stats,xtabs)
importFrom(tibble,add_column)
importFrom(tibble,add_row)
importFrom(tibble,as_tibble)
importFrom(tibble,has_name)
importFrom(tibble,has_rownames)
importFrom(tibble,is.tibble)
importFrom(tibble,lst)
importFrom(tibble,rownames_to_column)
importFrom(tibble,tibble)
importFrom(tibble,tidy_names)
importFrom(tidyr,gather)
importFrom(tidyr,nest)
importFrom(tidyr,spread)
importFrom(tidyr,unnest)
importFrom(tidyselect,contains)
importFrom(tidyselect,ends_with)
importFrom(tidyselect,starts_with)
importFrom(utils,browseURL)
importFrom(utils,setTxtProgressBar)
importFrom(utils,txtProgressBar)
This diff is collapsed.
This diff is collapsed.
#' @importFrom scales brewer_pal grey_pal
col_check2 <- function(geom.colors, collen) {
# --------------------------------------------
# check color argument
# --------------------------------------------
# check for corrct color argument
if (!is.null(geom.colors)) {
# check for color brewer palette
if (is.brewer.pal(geom.colors[1])) {
geom.colors <- scales::brewer_pal(palette = geom.colors[1])(collen)
} else if (is.sjplot.pal(geom.colors[1])) {
geom.colors <- get_sjplot_colorpalette(geom.colors[1], collen)
} else if (is.wes.pal(geom.colors[1])) {
geom.colors <- get_wesanderson_colorpalette(geom.colors[1], collen)
} else if (geom.colors[1] %in% c("v", "viridis")) {
geom.colors <- get_viridis_colorpalette(collen)
# do we have correct amount of colours?
} else if (geom.colors[1] == "gs") {
geom.colors <- scales::grey_pal()(collen)
# do we have correct amount of colours?
} else if (geom.colors[1] == "bw") {
geom.colors <- rep("black", times = collen)
# do we have correct amount of colours?
} else if (length(geom.colors) > collen) {
# shorten palette
geom.colors <- geom.colors[1:collen]
} else if (length(geom.colors) < collen) {
# repeat color palette
geom.colors <- rep(geom.colors, times = collen)
# shorten to required length
geom.colors <- geom.colors[1:collen]
}
} else {
geom.colors <- scales::brewer_pal(palette = "Set1")(collen)
}
geom.colors
}
# check whether a color value is indicating
# a color brewer palette
is.brewer.pal <- function(pal) {
bp.seq <- c("BuGn", "BuPu", "GnBu", "OrRd", "PuBu", "PuBuGn", "PuRd", "RdPu",
"YlGn", "YlGnBu", "YlOrBr", "YlOrRd", "Blues", "Greens", "Greys",
"Oranges", "Purples", "Reds")
bp.div <- c("BrBG", "PiYG", "PRGn", "PuOr", "RdBu", "RdGy", "RdYlBu",
"RdYlGn", "Spectral")
bp.qul <- c("Accent", "Dark2", "Paired", "Pastel1", "Pastel2", "Set1",
"Set2", "Set3")
bp <- c(bp.seq, bp.div, bp.qul)
pal %in% bp
}
is.sjplot.pal <- function(pal) {
pal %in% c("aqua", "warm", "dust", "blambus", "simply", "us", "random")
}
is.wes.pal <- function(pal) {
pal %in% c("GrandBudapest", "Moonrise1", "Royal1", "Moonrise2", "Cavalcanti", "Royal2",
"GrandBudapest2", "Moonrise3", "Chevalier", "Zissou", "FantasticFox",
"Darjeeling", "Rushmore", "BottleRocket", "Darjeeling2")
}
get_wesanderson_colorpalette <- function(pal, len) {
if (!requireNamespace("wesanderson", quietly = TRUE)) {
warning("Package `wesanderson` required for this color palette.", call. = F)
return(NULL)
}
wesanderson::wes_palette(name = pal, n = len)
}
get_viridis_colorpalette <- function(len) {
if (!requireNamespace("viridis", quietly = TRUE)) {
warning("Package `viridis` required for this color palette.", call. = F)
return(NULL)
}
viridis::viridis(n = len)
}
get_sjplot_colorpalette <- function(pal, len) {
col <- NULL
if (pal == "random")
pal <- sample(c("aqua", "warm", "dust", "blambus", "simply", "us"), size = 1)
if (pal == "aqua")
col <- c("#BAF5F3", "#46A9BE", "#8B7B88", "#BD7688", "#F2C29E", "#BAF5F3", "#46A9BE", "#8B7B88")
else if (pal == "warm")
col <- c("#F8EB85", "#F1B749", "#C45B46", "#664458", "#072835", "#F8EB85", "#F1B749", "#C45B46")
else if (pal == "dust")
col <- c("#AAAE9D", "#F8F7CF", "#F7B98B", "#7B5756", "#232126", "#AAAE9D", "#F8F7CF", "#F7B98B")
else if (pal == "blambus")
col <- c("#5D8191", "#F2DD26", "#494949", "#BD772D", "#E02E1F", "#5D8191", "#F2DD26", "#494949")
else if (pal == "simply")
col <- c("#CD423F", "#FCDA3B", "#0171D3", "#018F77", "#F5C6AC", "#CD423F", "#FCDA3B", "#0171D3")
else if (pal == "us")
col <- c("#004D80", "#376C8E", "#37848E", "#9BC2B6", "#B5D2C0", "#004D80", "#376C8E", "#37848E")
if (len > length(col)) {
warning("More colors requested than length of color palette.", call. = F)
len <- length(col)
}
col[1:len]
}
This diff is collapsed.
This diff is collapsed.
plot_diag_linear <- function(model,
geom.colors,
dot.size,
...) {
plot.list <- list()
geom.colors <- col_check2(geom.colors, 2)
p <- diag_vif(model)
if (!is.null(p)) plot.list[[length(plot.list) + 1]] <- p
p <- diag_qq(model, geom.colors)
if (!is.null(p)) plot.list[[length(plot.list) + 1]] <- p
p <- diag_reqq(model, dot.size)
if (!is.null(p)) plot.list[[length(plot.list) + 1]] <- p
p <- diag_norm(model, geom.colors)
if (!is.null(p)) plot.list[[length(plot.list) + 1]] <- p
p <- diag_ncv(model)
if (!is.null(p)) plot.list[[length(plot.list) + 1]] <- p
plot.list
}
plot_diag_glm <- function(model, geom.colors, dot.size, ...) {
geom.colors <- col_check2(geom.colors, 2)
diag_reqq(model, dot.size)
}
#' @importFrom tibble tibble
#' @importFrom stats residuals fitted
diag_ncv <- function(model) {
dat <- tibble::tibble(
res = stats::residuals(model),
fitted = stats::fitted(model)
)
ggplot(dat, aes_string(x = "fitted", y = "res")) +
geom_intercept_line2(0, NULL) +
geom_point() +
geom_smooth(method = "loess", se = FALSE) +
labs(
x = "Fitted values",
y = "Residuals",
title = "Homoscedasticity (constant variance of residuals)",
subtitle = "Amount and distance of points scattered above/below line is equal or randomly spread"
)
}
#' @importFrom rlang .data
#' @importFrom tibble tibble
#' @importFrom stats residuals sd
diag_norm <- function(model, geom.colors) {
res_ <- tibble::tibble(res = stats::residuals(model))
ggplot(res_, aes_string(x = "res")) +
geom_density(fill = geom.colors[1], alpha = 0.2) +
stat_function(
fun = dnorm,
args = list(
mean = mean(unname(stats::residuals(model)), na.rm = TRUE),
sd = stats::sd(unname(stats::residuals(model)), na.rm = TRUE)
),
colour = geom.colors[2],
size = 0.8
) +
labs(
x = "Residuals",
y = "Density",
title = "Non-normality of residuals",
subtitle = "Distribution should look like normal curve"