props: Proportion plots and/or tables

Description Usage Arguments Author(s) Examples

View source: R/MTfuncs_all.R

Description

Creates bar charts with 95% Jeffries confidence intervals and/or output tables from input vectors of factor data

Usage

1
2
3
props(x, y = rep(1, length(x)), numvar = 2,
  xname = deparse(substitute(x)), yname = deparse(substitute(y)),
  plot = T, kable = F, table = T)

Arguments

x

First vector of factor data

y

Second vector of factor data. If a second vector is used, it makes plots/tables of the proportions of variable 1 for each unique value of variable 2

numvar

Number of input variables (1 or 2)

xname

Name of x to use for plots/tables

yname

Name of y to use for plots/tables

plot

Whether a plot is produced (TRUE or FALSE)

kable

Whether to use kable format for tables, for use in R markdown (requires knitr package) #'

table

Whether a table is produced (TRUE or FALSE)

Author(s)

Matt Tyers

Examples

1
2
3
4
5
6
lake <- sample(c("lake 1","lake 2"),20,replace=T)
spec <- sample(c("rainbow","cutthroat"),20,replace=T)
data.frame(lake,spec)

par(mfrow=c(2,1))
props(spec,lake,xname="Species",yname="Lake")

mbtyers/MTfuncs documentation built on May 22, 2017, 12:16 a.m.