Vector_graph_data: Compile Vectors into a graphable format

Description Usage Arguments Details Value Author(s) Examples

Description

This function takes a list of vectors and compiles them into a dataframe to use with ggpolt2

Usage

1

Arguments

vectors

List of vector names already in Global Environment

Details

This function compiles numeric vectors into short format for ggplot graphing

Value

the output is a data frame containing the names of the input vectors, matched with the values of the input vectors.

Author(s)

atomczik

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (vectors) 
{
    name <- vectors
    mean <- "blank"
    sd <- "blank"
    for (i in 1:length(name)) {
        mean[i] <- round(mean(get(name[i])), digits = 4)
        sd[i] <- round(sd(get(name[i])), digits = 4)
    }
    fig.1.data <- as.data.frame(cbind(name, mean, sd))
    fig.1.data$name <- with(fig.1.data, factor(name, levels = (unique(name))))
    fig.1.data$mean <- as.numeric(as.character(fig.1.data$mean))
    return(fig.1.data)
  }

dlemas/microbes documentation built on May 15, 2019, 9:15 a.m.