etiennebacher / loc

R package to count lines of code in many programming languages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

loc

R-CMD-check

loc provides a single function, count_loc(), whose purpose is to count lines of code. You can provide specific paths to include or exclude, consider hidden files or not, and you have access to a long list of languages.

Under the hood, loc uses the tokei Rust crate.

Installation

Windows or macOS

install.packages(
  'loc', 
  repos = c('https://etiennebacher.r-universe.dev', getOption("repos"))
)

Linux

install.packages(
  'loc', 
  repos = c('https://etiennebacher.r-universe.dev/bin/linux/jammy/4.3', getOption("repos"))
)

Example

Here’s what was needed to make this package:

library(loc)

count_loc(paths = c("R", "src"), languages = c("R", "Rust"))
#> 
#> Language: R 
#> ===================
#> Lines of code: 266 
#> Blank lines:   9 
#> Comments:      59 
#> Accurate:      Yes
#> 
#> Language: Rust 
#> ===================
#> Lines of code: 258 
#> Blank lines:   7 
#> Comments:      28 
#> Accurate:      Yes

About

R package to count lines of code in many programming languages

License:Other


Languages

Language:Rust 57.5%Language:R 41.5%Language:C 1.0%