MyNixOS website logo
Description

Useful Tools for Jurimetrical Analysis Used by the Brazilian Jurimetrics Association.

The Brazilian Jurimetrics Association (ABJ in Portuguese, see <https://abj.org.br/> for more information) is a non-profit organization which aims to investigate and promote the use of statistics and probability in the study of Law and its institutions. This package implements general purpose tools used by ABJ, such as functions for sampling and basic manipulation of Brazilian lawsuits identification number. It also implements functions for text cleaning, such as accentuation removal.

abjutils

CRAN_Status_Badge R buildstatus

Visão Geral

{abjutils} is a toolkit with some useful functions created by the Brazilian Jurimetrics Association (Associação Brasileira de Jurimetria).

Most functions help with identifying lawsuit IDs as specified by the National Justice Council (Conselho Nacional de Justiça): NNNNNNN-DD.AAAA.J.TR.OOOO. The rest helps with ASCII and other formatting problems.

Installation

You can install the most recent version of {abjutils} with:

# CRAN
install.packages("abjutils")

# GitHub (dev)
install.packages("remotes")
remotes::install_github("abjur/abjutils")

Functions

FunctionDescription
build_id()Add separators to ID
calc_dig()Calculate verification digit of an ID
carf_build_id()Add digits to CARF ID
carf_calc_dig()Calculate verification digit of a CARF ID
carf_check_dig()Check digits of a CARF ID
check_dig()Check digits of an ID
check_dig_vet()Check a verification digit vector
chrome_to_body()Convert POST parameters to a list
clean_cnj()Remove non-numeric characters from a string
clean_id()Remove separators from an ID
escape_unicode()Replace extended Latin characters with escaped Unicode
extract_parts()Extract ID parts
file_sans_ext()Extract filename without extension
gather_subjects()Gather ESAJ subjects automatically
lsos()List objects in an R session
pattern_cnj()Regex pattern to find IDs
precision()Apply precision scale
reais()Convert BRL strings into numbers
rm_accent()Remove diacritics from a string
sample_cnj()Create a random sample of IDs
separate_cnj()Separate a column of IDs into 6 columns with its components
tabela()Create a contingency table of a vector
test_fun()Check if all arguments from a function are set
verify_cnj()Check if ID conforms with CNJ’s standard
write_data()Write file to data/

Usage

Example 1:

# Remove separators from ID
abjutils::clean_id(c("1025736-09.2014.8.26.0100","0043877-64.2012.8.26.0100","1013689-61.2018.8.26.0100"))
#> [1] "10257360920148260100" "00438776420128260100" "10136896120188260100"

Example 2:

# Extract components from ID
abjutils::extract_parts(c("1025736-09.2014.8.26.0100","0043877-64.2012.8.26.0100","1013689-61.2018.8.26.0100"))
#> [[1]]
#>         N         D         A         J         T         O 
#> "1025736"      "09"    "2014"       "8"      "26"    "0100" 
#> 
#> [[2]]
#>         N         D         A         J         T         O 
#> "0043877"      "64"    "2012"       "8"      "26"    "0100" 
#> 
#> [[3]]
#>         N         D         A         J         T         O 
#> "1013689"      "61"    "2018"       "8"      "26"    "0100"

Example 3:

# Remove diacritics from string
abjutils::rm_accent("acórdão")
#> [1] "acordao"

Dependencies

{abjutils} requires R >= 3.6.

License

{abjutils} is licensed under MIT + file LICENSE.

Metadata

Version

0.3.2

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows