-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathREADME.Rmd
109 lines (84 loc) · 3.36 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# abjutils <a href='http://abjur.github.io/abjutils/'><img src='man/figures/logo.png' align="right" height="138.5" /></a>
<!-- badges: start -->
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/abjutils)](https://cran.r-project.org/package=abjutils)
[![R build status](https://github.com/abjur/abjutils/workflows/R-CMD-check/badge.svg)](https://github.com/abjur/abjutils/actions)
<!-- badges: end -->
## Visão Geral
`{abjutils}` is a toolkit with some useful functions created by the Brazilian
Jurimetrics Association
([Associação Brasileira de Jurimetria](https://abj.org.br/)).
Most functions help with identifying lawsuit IDs as specified by the National
Justice Council
([Conselho Nacional de Justiça](https://www.cnj.jus.br/programas-e-acoes/numeracao-unica/documentos/)):
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:
```{r eval=FALSE}
# CRAN
install.packages("abjutils")
# GitHub (dev)
install.packages("remotes")
remotes::install_github("abjur/abjutils")
```
## Functions
Function | Description
------------------ | -----------------------------------------------------------
`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:
```{r}
# 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"))
```
Example 2:
```{r}
# 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"))
```
Example 3:
```{r}
# Remove diacritics from string
abjutils::rm_accent("acórdão")
```
## Dependencies
`{abjutils}` requires R >= 3.6.
## License
`{abjutils}` is licensed under
[MIT + file LICENSE](https://github.com/abjur/abjutils/blob/master/LICENSE)