Skip to content

Commit

Permalink
ajoute github CI R-CMD-check
Browse files Browse the repository at this point in the history
  • Loading branch information
py-b committed Oct 22, 2023
1 parent fc96f6c commit 81b8acc
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
27 changes: 27 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
53 changes: 53 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

# validinsee

<!-- badges: start -->
![GitHub top language](https://img.shields.io/github/languages/top/InseeFrLab/validinsee)
[![R-CMD-check](https://github.com/InseeFrLab/validinsee/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/InseeFrLab/validinsee/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/validinsee)](https://cran.r-project.org/package=validinsee)
<!-- badges: end -->

Le package R **validinsee** permet de valider certaines données produites par
l'Insee, en particulier la conformité de numéros Siren ou Siret.

## Installation

``` r
# install.packages("remotes")
devtools::install_github("InseeFrLab/validinsee")
```

## Chargement

```{r}
library(validinsee)
```

## Validité de numéros SIREN ou SIRET

Utiliser la fonction `validation_sirene` pour vérifier si les éléments du
vecteur sont des **SIRET** valides (identifiant de l'établissement formé de 14
caractères) :

```{r valid_siret}
validation_sirene(c("20003452800014", "20003452800041", NA))
```

Pour vérifier que les éléments sont des **SIREN** valides (identifiant de
l'entreprise formé de 9 caractères), préciser l'argument `type = "siren"` :

```{r valid_siren}
validation_sirene(c("200034528", "200034582", NA), type = "siren")
```
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# validinsee

<!-- badges: start -->

![GitHub top
language](https://img.shields.io/github/languages/top/InseeFrLab/validinsee)
[![R-CMD-check](https://github.com/InseeFrLab/validinsee/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/InseeFrLab/validinsee/actions/workflows/R-CMD-check.yaml)
[![CRAN
status](https://www.r-pkg.org/badges/version/validinsee)](https://cran.r-project.org/package=validinsee)
<!-- badges: end -->

Le package R **validinsee** permet de valider certaines données
produites par l’Insee, en particulier la conformité de numéros Siren ou
Siret.

## Installation

``` r
# install.packages("remotes")
devtools::install_github("InseeFrLab/validinsee")
```

## Chargement

``` r
library(validinsee)
```

## Validité de numéros SIREN ou SIRET

Utiliser la fonction `validation_sirene` pour vérifier si les éléments
du vecteur sont des **SIRET** valides (identifiant de l’établissement
formé de 14 caractères) :

``` r
validation_sirene(c("20003452800014", "20003452800041", NA))
#> [1] TRUE FALSE NA
```

Pour vérifier que les éléments sont des **SIREN** valides (identifiant
de l’entreprise formé de 9 caractères), préciser l’argument
`type = "siren"` :

``` r
validation_sirene(c("200034528", "200034582", NA), type = "siren")
#> [1] TRUE FALSE NA
```

0 comments on commit 81b8acc

Please sign in to comment.