View source: R/ch.filterDataBetween.r
ch.filterGrpBtwn | R Documentation |
This function filters the data, based on a grouping variable, between a low threshold and/or a high threshold. 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.filterGrpBtwn(
data,
dataCol,
grpCol,
lowThresh = NULL,
highThresh = NULL,
FUN
)
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 that specifies the name of the column in "data" that acts as a grouping variable. |
lowThresh |
the lower threshold that the data must be above to be kept. |
highThresh |
the higher threshold that the data must be below to be kept. |
FUN |
the function that specifies the how to combine dataCol by grpCol (e.g., mean). |
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.filterGrpBtwn (data=myDataFrame, "RT", "sn", 200, 5000, mean)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.