code_freq_by {rock} | R Documentation |
Code frequencies separate by a variable
Description
Code frequencies separate by a variable
Usage
code_freq_by(x, by, codes = ".*", returnTidyDf = FALSE)
Arguments
x |
The object with parsed sources. |
by |
The variables on which to split when computing code frequencies. |
codes |
A regular expression specifying the codes fo which to compute the code frequencies. |
returnTidyDf |
When |
Value
A data frame with the code frequencies
Examples
### Get path to example source
examplePath <-
system.file("extdata", package="rock");
### Get a path to one example file
exampleFile <-
file.path(examplePath, "example-1.rock");
### Load example source
loadedExample <- rock::parse_source(exampleFile);
### Show code frequencies
code_freq_by(loadedExample, "nestingLevel");
[Package rock version 0.9.6 Index]