Package 'loc'

Title: What the Package Does (Title Case)
Description: More about what it does (maybe more than one line) Use four spaces when indenting paragraphs within the Description.
Authors: Who wrote it
Maintainer: The package maintainer <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-10-10 05:14:16 UTC
Source: https://github.com/etiennebacher/loc

Help Index


loc: What the Package Does (Title Case)

Description

More about what it does (maybe more than one line) Use four spaces when indenting paragraphs within the Description.

See Also

Useful links:


Count lines of code

Description

Count lines of code

Usage

count_loc(
  paths = ".",
  excluded = NULL,
  include_hidden = FALSE,
  languages = "R"
)

Arguments

paths

Paths to include.

excluded

Paths to exclude.

include_hidden

Count hidden files and directories? Default is FALSE.

languages

Languages to consider. See the list here: https://github.com/XAMPPRocky/tokei?tab=readme-ov-file#supported-languages.

Value

A data.frame with 4 columns: number of blank lines, comments, code, and whether the count is accurate.

Examples

tmp <- tempfile(fileext = ".R")
cat("
library(loc)
# This is a wrong function
foo <- function(x) {
  x + 1
}

", file = tmp)
count_loc(tmp)