Description Usage Arguments Details Value Author(s) Examples
This function takes a list of vectors and compiles them into a dataframe to use with ggpolt2
1 | Vector_graph_data(vectors)
|
vectors |
List of vector names already in Global Environment |
This function compiles numeric vectors into short format for ggplot graphing
the output is a data frame containing the names of the input vectors, matched with the values of the input vectors.
atomczik
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.