View source: R/ch.filterGrpByN.r
ch.filterGrpByN | R Documentation |
This function filters the data, it can be grouped using a grouping variable. Basically, it removes all the rows that have fewer than lowNthreshold observations. It returns a list that contains a dataframe of the removed data, a dataframe of the the kept data, the number of datapoints removed, and the percentage of points removed.
ch.filterGrpByN(data, dataCol, grpCol = NULL, lowNthreshold = 0)
data |
a dataframe containing the data. |
dataCol |
a string that specifies the name of the column in "data" on which the thresholds are to act. |
grpCol |
a string or vector of strings that specify the names of the column in "data" that act as grouping variables. |
lowNthreshold |
An integer above 0 that specifies the minimum number of observations that the condition must have to be kept in the dataset. DEFAULT = 0 |
a list containing: (datRemoved) a dataframe with the removed data as grouped by grpCol; (datKept) a dataframe with the kept data as grouped by grpCol; (numRemoved) the number of datapoints removed; (pRemoved) the proportion of datapoints removed; (datKeptRaw) a dataframe with the kept data in the raw format (ungrouped);.
ch.filterGrpByN (data=myDataFrame, "RT", "overlapRound", lowNthreshold=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.