Commit f5b5be10 authored by Gjalt-Jorn Peters's avatar Gjalt-Jorn Peters

forgot to push

parent ff964a5b
Pipeline #214137562 passed with stage
in 5 minutes and 18 seconds
......@@ -39,6 +39,7 @@ Suggests:
bootES (>= 1.2),
car (>= 3.0),
careless (>= 1.1),
GGally (>= 1.4.0),
jmvcore (>= 1.2),
lavaan (>= 0.6),
MBESS (>= 4.5.1),
......@@ -50,7 +51,6 @@ Suggests:
Imports: digest (>= 0.6.19),
diptest (>= 0.75.7),
dplyr (>= 0.7.6),
GGally (>= 1.4.0),
ggplot2 (>= 2.2.1),
ggrepel (>= 0.8),
ggridges (>= 0.5.0),
......
......@@ -136,6 +136,7 @@ export(ggEasyRidge)
export(ggProportionPlot)
export(ggSave)
export(ggqq)
export(heading)
export(ifelseObj)
export(insertFigureCaption)
export(insertNumberedCaption)
......
......@@ -142,6 +142,9 @@ ggBoxplot <- function(dat, y = NULL, x = NULL,
datF$outlier <- iqrOutlier(datF[, y]);
return(datF);
});
dat$outlier <- ifelse(dat$outlier,
1:nrow(dat),
as.numeric(NA));
......
#' Print a heading
#'
#' This is just a convenience function to print a markdown or HTML heading at
#' a given 'depth'.
#'
#' @param ... The heading text: pasted together with no separator.
#' @param headingLevel The level of the heading; the default can be set
#' with e.g. `ufs::opts$set(defaultHeadingLevel=1)`.
#' @param output Whether to output to HTML ("`html`") or markdown (anything
#' else).
#' @param cat Whether to cat (print) the heading or just invisibly return it.
#'
#' @return The heading, invisibly.
#' @export
#'
#' @examples heading("Hello ", "World", headingLevel=5);
#' ### This produces: "\\n\\n##### Hello World\\n\\n"
heading <- function(...,
headingLevel = ufs::opts$get("defaultHeadingLevel"),
output = "markdown",
cat = TRUE) {
text <- paste0(..., collapse="");
if (output == "html") {
res <- paste0(
"\n\n<h", headingLevel, "> ",
text, "</h", headingLevel, ">\n\n"
);
} else {
res <- paste0(
"\n\n",
repStr("#", headingLevel), " ",
text, "\n\n"
);
}
if (cat) {
cat(res);
}
return(invisible(res));
}
......@@ -206,6 +206,9 @@ opts$defaults <-
ggBaseSize = 11,
### Default heading level, for convenience
defaultHeadingLevel = 3,
### Where to print tables; 'console', 'viewer', and/or
### one or more filenames in existing directories
tableOutput = c("console", "viewer"),
......
......@@ -82,6 +82,12 @@ quietGitLabUpdate <- function(x,
quiet = TRUE,
errorInvisible = TRUE,
...) {
if (!requireNamespace("remotes", quietly = TRUE)) {
stop("This is a wrapper for `remotes` functions; ",
"you need to have `remotes` installed to use it.");
}
quietRemotesInstall(x,
func = "install_gitlab",
unloadNamespace = unloadNamespace,
......
......@@ -11,6 +11,8 @@
#'
#' @param formula The formule of the regression analysis.
#' @param data The data to use for the analysis.
#' @param createPlot Whether to create the scattermatrix (requires the `GGally`
#' package to be installed).
#' @param x Object to print.
#' @param headingLevel The number of hash symbols to prepend to the heading.
#' @param ... Additional arguments are passed on to the `regr` print function.
......@@ -25,7 +27,18 @@
#' regrInfluential(mpg ~ hp, mtcars);
#'
#' @export regrInfluential
regrInfluential <- function(formula, data) {
regrInfluential <- function(formula, data, createPlot = TRUE) {
if (createPlot) {
suppressMessages(suppressWarnings(
if (!requireNamespace("GGally")) {
stop("You need the {GGally} package to use this function!\n\n",
"You can install it with the following command:\n\n",
"install.packages('GGally');");
}
));
}
### Create object for results and store input
res <- list(input = as.list(environment()), intermediate = list(),
output = list())
......
......@@ -65,11 +65,13 @@ scatterMatrix <- function(dat, items=NULL,
conf.level = .95,
...) {
suppressMessages(
suppressMessages(suppressWarnings(
if (!requireNamespace("GGally")) {
stop("You need the {GGally} package to use this function!");
stop("You need the {GGally} package to use this function!\n\n",
"You can install it with the following command:\n\n",
"install.packages('GGally');");
}
);
));
if (is.null(items)) {
items <- names(dat);
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/heading.R
\name{heading}
\alias{heading}
\title{Print a heading}
\usage{
heading(
...,
headingLevel = ufs::opts$get("defaultHeadingLevel"),
output = "markdown",
cat = TRUE
)
}
\arguments{
\item{...}{The heading text: pasted together with no separator.}
\item{headingLevel}{The level of the heading; the default can be set
with e.g. \code{ufs::opts$set(defaultHeadingLevel=1)}.}
\item{output}{Whether to output to HTML ("\code{html}") or markdown (anything
else).}
\item{cat}{Whether to cat (print) the heading or just invisibly return it.}
}
\value{
The heading, invisibly.
}
\description{
This is just a convenience function to print a markdown or HTML heading at
a given 'depth'.
}
\examples{
heading("Hello ", "World", headingLevel=5);
### This produces: "\\n\\n##### Hello World\\n\\n"
}
......@@ -5,7 +5,7 @@
\alias{print.regrInfluential}
\title{Detecting influential cases in regression analyses}
\usage{
regrInfluential(formula, data)
regrInfluential(formula, data, createPlot = TRUE)
\method{print}{regrInfluential}(x, headingLevel = 3, ...)
}
......@@ -14,6 +14,9 @@ regrInfluential(formula, data)
\item{data}{The data to use for the analysis.}
\item{createPlot}{Whether to create the scattermatrix (requires the \code{GGally}
package to be installed).}
\item{x}{Object to print.}
\item{headingLevel}{The number of hash symbols to prepend to the heading.}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment