| Title: | Count Lines of Code |
|---|---|
| Description: | Use the 'Tokei' Rust crate to count lines of code in files and folders. It supports dozens of different languages, and also provides statistics on blank lines and comments. |
| Authors: | Etienne Bacher [aut, cre, cph] |
| Maintainer: | Etienne Bacher <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2 |
| Built: | 2026-10-07 08:56:11 UTC |
| Source: | https://github.com/etiennebacher/loc |
Count lines of code
count_loc( paths = ".", excluded = NULL, include_hidden = FALSE, languages = "R" )count_loc( paths = ".", excluded = NULL, include_hidden = FALSE, languages = "R" )
paths |
Paths to include. |
excluded |
Paths to exclude. |
|
Count hidden files and directories? Default is |
|
languages |
Languages to consider. See the list here: https:#github.com/XAMPPRocky/tokei?tab=readme-ov-file#supported-languages. |
A data.frame with 4 columns: number of blank lines, comments, code, and whether the count is accurate.
tmp <- tempfile(fileext = ".R") cat(" library(loc) # This is a function foo <- function(x) { x + 1 } ", file = tmp) count_loc(tmp)tmp <- tempfile(fileext = ".R") cat(" library(loc) # This is a function foo <- function(x) { x + 1 } ", file = tmp) count_loc(tmp)