Skip to content
Snippets Groups Projects
Commit 1ba8f691 authored by Otto, Dr. Saskia's avatar Otto, Dr. Saskia
Browse files

fixed issue of not exporting

parent c871ff2e
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,8 @@ export(calc_vif)
export(explore_na)
export(impute)
export(panel_cor)
export(panel_hist)
export(panel_lines)
export(plot_statespace_ch)
export(plot_statespace_ed)
export(statespace_ch)
......
#' Show correlation coefficient in pairs plot
#' Show correlation coefficient, histogram or regression lines in pairs plot
#'
#' This and the other functions are utility functions for the pairs plot.
#' \code{panel_cor} shows the Pearson product-moment correlation coefficient in
#' the selected panels. \code{panel_lines} shows the regression line and
#' \code{panel_cor}, \code{panel_lines} and \code{panel_hist} are utility functions
#' for the pairs plot. \code{panel_cor} shows the Pearson product-moment correlation
#' coefficient in the selected panels. \code{panel_lines} shows the regression line and
#' \code{panel_hist} histograms.
#'
#' @param x numeric vector
#' @param y numeric vector
#' @name panel_funcs
#' @seealso \code{\link{pairs}}
#' @export
#' @examples
#' z <- matrix(rnorm(40), ncol = 4)
#' pairs(z, upper.panel = panel_cor,
#' lower.panel = panel_lines, diag.panel = panel_hist)
NULL
#' @rdname panel_funcs
#' @export
panel_cor <- function(x, y) {
par(usr = c(0, 1, 0, 1))
r <- stats::cor(x, y,use = "pairwise.complete.obs")
......@@ -18,7 +25,8 @@ panel_cor <- function(x, y) {
text(0.5, 0.5, txt, cex = 0.9/strwidth(txt) * abs(r))
}
#' @rdname panel_cor
#' @rdname panel_funcs
#' @export
panel_lines <- function (x, y) {
points(x, y, bg = NA, cex = 1)
sel <- is.finite(x) & is.finite(y)
......@@ -27,8 +35,8 @@ panel_lines <- function (x, y) {
abline(lml, col = "blue")}
}
#' @rdname panel_cor
#' @rdname panel_funcs
#' @export
panel_hist <- function(x) {
usr <- par("usr")
par(usr = c(usr[1:2], 0, 1.5) )
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/panel_cor.R
\name{panel_cor}
% Please edit documentation in R/panel_funcs.R
\name{panel_funcs}
\alias{panel_funcs}
\alias{panel_cor}
\alias{panel_lines}
\alias{panel_hist}
\title{Show correlation coefficient in pairs plot}
\title{Show correlation coefficient, histogram or regression lines in pairs plot}
\usage{
panel_cor(x, y)
......@@ -18,11 +19,16 @@ panel_hist(x)
\item{y}{numeric vector}
}
\description{
This and the other functions are utility functions for the pairs plot.
\code{panel_cor} shows the Pearson product-moment correlation coefficient in
the selected panels. \code{panel_lines} shows the regression line and
\code{panel_cor}, \code{panel_lines} and \code{panel_hist} are utility functions
for the pairs plot. \code{panel_cor} shows the Pearson product-moment correlation
coefficient in the selected panels. \code{panel_lines} shows the regression line and
\code{panel_hist} histograms.
}
\examples{
z <- matrix(rnorm(40), ncol = 4)
pairs(z, upper.panel = panel_cor,
lower.panel = panel_lines, diag.panel = panel_hist)
}
\seealso{
\code{\link{pairs}}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment