linesofcode | R Documentation |
This is just a way to summarize how many lines of code appear to be in the .R files in the folder that a package is built from.
linesofcode(
folder = getwd(),
packages,
recursive = TRUE,
sums = FALSE,
rfolderonly = FALSE,
cropfilename = 40,
croppath = 20,
showrows = NULL
)
folder |
Default is current working directory. **This is NOT the base path of the package itself! It is the full path of the folder within which is a folder for each package of interest. For example, folder= '~/Documents/R PACKAGES' works but folder= '~/Documents/R PACKAGES/mypkg' does not see the package called mypkg |
packages |
Default is all found in folder. Can specify a subset of those by name as character vector. |
recursive |
Default is TRUE, searches subfolders within specified folder. |
sums |
Default is FALSE, but if TRUE it returns the count of .R files and lines of code for each package found. |
rfolderonly |
optional |
cropfilename |
number of characters displayed in console |
croppath |
number of characters displayed in console |
showrows |
number of rows displayed in console |
Returns a data.frame of results, with details depending on sums parameter. Also prints summary info if sums=FALSE, and returns detailed info.
## Not run:
linesofcode(folder= '..', packages=c('analyze.stuff', 'proxistat') )
x <- linesofcode(folder= '~/Documents/R PACKAGES')
x[order(x$code), c('filename', 'package', 'code')]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.