Skip to content
Permalink
c5d03d2a60
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
26 lines (24 sloc) 1.07 KB
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/count.column.R
\name{count.column}
\alias{count.column}
\title{Counts by 2 grouping varaibles}
\usage{
count.column(df, factor_one = "group",
factor_two = "primary_diagnosis")
}
\arguments{
\item{df}{Data frame, in this case meta data of a corresponding gene}
\item{factor_one}{Character - first grouping factor, a column name of the data frame}
\item{factor_two}{Character - second grouping factor, a column name of the data frame}
}
\value{
Returns a data frame
}
\description{
This function simply groups by two factors and returns the frequency. Can be passed to "use.prop.test" to test proportions.
}
\examples{
df <- data.frame(case_id = c(1,2,3,4,5,6), group = c("one","one","two","one","two","three"), primary_diagnosis = c("Squamous cell carcinoma, NOS", "Adenocarcinoma, NOS", "Adenocarcinoma with mixed subtypes", "Squamous cell carcinoma, NOS", "Squamous cell carcinoma, NOS", "Squamous cell carcinoma, NOS"))
diagnosis_counts <- count.column(df, factor_one = "group", factor_two = "primary_diagnosis")
}