sumdater: Data Summary

Description Usage Arguments Value Examples

View source: R/Data summary.R

Description

Gives count, sum, max, min, mean, standard deviation, standard error of the mean, and confidence interval. I altered this from the Rmisc::summarySE func.

Usage

1
2
sumdater(data = NULL, measurevar, groupvars = NULL, na.rm = FALSE,
  conf.interval = 0.95, .drop = TRUE)

Arguments

data

a data frame to summarize

measurevar

the name of a column that contains the variable to be summariezed

groupvars

a vector containing names of columns that contain grouping variables

na.rm

a boolean that indicates whether to ignore NA's

conf.interval

the percent range of the confidence interval (default is 95 percent)

.drop

should combinations of variables that do not appear in the input data be preserved (FALSE) or dropped (TRUE, default)

Value

Returns a dataframe with the summary metrics. Usefull in data exploration, plotting whisker plots, and other good ish.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## make sample data
a = seq(0,2000,length.out = 40)
b = seq(2000,4000,length.out = 40)
c = c(rep("blue",20),rep("red",20))
d = c(rep("north",10),rep("west",10),rep("south",10),rep("east",10))

##join above obejcts to dataframe
tmp = cbind.data.frame(a,b,c,d)

##Look at data fame
tmp

##Single grouping variables
sumdater(tmp,measurevar = "a",groupvars = "c")
sumdater(tmp,measurevar = "a",groupvars = "d")

##multiple grouping variables
sumdater(tmp,measurevar = "a",groupvars = c("c","d"))

wrbrignon/BrignonPackage documentation built on May 4, 2019, 10:54 a.m.