Calculate the proportion of specified values in a vector
propbrk.RdCalculates the proportion of values in a vector that are equal to a specified value.
Details
propbrk calculates the proportion of values matching a specified value. It is mainly to allow proportions to be calculated in the brkdnNest function. It always discards NAs in x when summing the number equal to trueval, but respects the na.rm argument when calculating the total number of values in x.
Examples
propbrk(sample(LETTERS,100,TRUE),trueval="M")
#> [1] 0.05