Plots: Creates a List of ggplots: density or boxplot

Description Usage Arguments Value Examples

View source: R/Plots.R

Description

Function to generate ggplot objects using lapply

If the data frame contains a single factor column the plot will assume it as the dependent variable

If ptype = 1, density plots will be produced

If ptype = 2, box plots will be produced

Usage

1
Plots(x, column, colorData = NULL, ptype = 1)

Arguments

x

A matrix-like R structure

column

A chr of column name

colorData

A dataframe column to designate target

ptype

A int of plot type

Value

ggplot object

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
#EXAMPLE

## End(Not run)
x <- data.frame("X1" = c(1,2,3,1,2,3),
                "X2" = 1:6,
                "F3"= c("male","female","male","female","male","male"))

plot_density <- lapply(colnames(x), Plots, x = x, colorData = x$F3, ptype = 1 )

ckornafel/expldata documentation built on Dec. 27, 2019, 2:20 a.m.