R/tidy.R

Defines functions input_tidy

Documented in input_tidy

#' Represent data in a 'tidy' format
#'
#' 'Tidy' data takes a 'long' view of data, where each variable is column.
#'
#' @details This approach popularized by Hadley Wickham; see the vignette
#'      in the package 'dplyr'.
#'
#' @param pdata_file character(1) The path to the phenotype data file.
#'
#' @param exprs_file character(1) The path to the expression data file.
#'
#' @return A data.frame()
#'
#' @importFrom reshape2 melt
#' @importFrom dplyr tbl_df
#' @importFrom magrittr %>%
#'
#' @export

input_tidy <- function(pdata_file, exprs_file) {
    classic <- input_classic(pdata_file, exprs_file)
    melt(classic, id.vars=1:22, variable.name="probeset",
         value.name="exprs") %>% tbl_df()
}
ziqiangc/Elbo documentation built on May 4, 2019, 11:23 p.m.