#'@title Convert a list to a data.frame
#'@description takes a list and converts it into a data.frame - without
#'strings converting to factors.
#'
#'@param list the input list
#'
#'@param result_names the names for the columns of the resulting
#'data.frame.
#'
#'@export
list_to_df <- function(list, result_names){
results <- data.frame(matrix(unlist(list), nrow = length(list), byrow = TRUE))
names(results) <- result_names
return(results)
}
#'@title convert variables in a data.frame to an aggregated matrix.
#'@description takes variables from a data.frame and generates
#'a matrix of the aggregated permutations; designed for running,
#'say, fisher tests against.
#'
#'@param ... data.frame variables.
#'
#'@export
df_vars_to_matrix <- function(...){
matrix(x = table(...),
nrow = length(...))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.