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
28 lines (26 sloc) 1.14 KB
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/counts.per.group.R
\name{counts.per.group}
\alias{counts.per.group}
\title{Group by and summarize counts}
\usage{
counts.per.group(list_df, first_grouping = "case_id",
second_grouping = "group")
}
\arguments{
\item{list_df}{Either a list of data frames or a single data frame}
\item{first_grouping}{Character - first grouping variable | Default "case_id"}
\item{second_grouping}{Character - second grouping variable | Default "group""}
}
\value{
Returns a data frame
}
\description{
This functions groups by 2 variables/columns with the counts of the combination. It accepts a list of data frames or a single data frame. When passing a single data frame this function will simply return a data frame with the counts. When using a list as input one might wants to know how often a patient(case_id)
appears in a group. If youre using a single data frame you need to change the grouping variables. Using ".id" as first_grouping and lists the counts of groups for the genes.
}
\examples{
Using a Data Frame
df <- data.frame()
df_counts <- counts.per.group(df, "firstColumn", "secondColumn")
}