README.Rmd 4.78 KB
Newer Older
Pyry Kantanen's avatar
Pyry Kantanen committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
output: github_document
---
  
```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
```

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

<!-- badges: start -->
16
[![rOG-badge](https://ropengov.github.io/rogtemplate/reference/figures/ropengov-badge.svg)](https://ropengov.org/)
Pyry Kantanen's avatar
Pyry Kantanen committed
17
  [![R build status](https://github.com/rOpenGov/hetu/workflows/R-CMD-check/badge.svg)](https://github.com/rOpenGov/hetu/actions)
18
  [![codecov](https://codecov.io/gh/rOpenGov/hetu/branch/master/graph/badge.svg)](https://app.codecov.io/gh/rOpenGov/hetu)
Pyry Kantanen's avatar
Pyry Kantanen committed
19
20
21
22
23
  [![Downloads](http://cranlogs.r-pkg.org/badges/grand-total/hetu)](https://cran.r-project.org/package=hetu)
  [![Downloads](http://cranlogs.r-pkg.org/badges/hetu)](https://cran.r-project.org/package=hetu)
  [![Watch on GitHub][github-watch-badge]][github-watch]
  [![Star on GitHub][github-star-badge]][github-star]
  [![Follow](https://img.shields.io/twitter/follow/ropengov.svg?style=social)](https://twitter.com/intent/follow?screen_name=ropengov)
24
  [![cran version](http://www.r-pkg.org/badges/version/hetu)](https://CRAN.R-project.org/package=hetu)
Pyry Kantanen's avatar
Pyry Kantanen committed
25
26
27
28
  <!-- badges: end -->

<!--[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/grand-total/hetu)](https://github.com/metacran/cranlogs.app)-->

dieghernan's avatar
dieghernan committed
29
# hetu - Structural Handling of Finnish Personal Identity Numbers <a href="https://ropengov.github.io/hetu/"><img src="man/figures/logo.png" align="right" height="139" /></a>
Pyry Kantanen's avatar
Pyry Kantanen committed
30

dieghernan's avatar
dieghernan committed
31
### Introduction 
Pyry Kantanen's avatar
Pyry Kantanen committed
32

33
`hetu` is an R package for structural handling of identification codes used in Finland, most importantly Finnish flavour of national identification numbers, the Finnish personal identity codes (in Finnish: henkilötunnus (hetu), in Swedish: personbeteckning). Some functions can also be used with Finnish Business ID numbers (in Finnish: yritys- ja yhteisötunnus (y-tunnus), in Swedish: företags- och organisationsnummer (FO-nummer)) and Finnish Unique Identification Numbers (FINUID, in Finnish: sähköinen asiointitunnus (SATU), in Swedish: elektronisk kommunikationskod).
Pyry Kantanen's avatar
Pyry Kantanen committed
34

35
The syntax in this package aims to be, when convenient, similar with another package specializing in national identification numbers: the [sweidnumbr](https://github.com/rOpenGov/sweidnumbr) R package for working with Swedish personal identity numbers and corporation identity numbers.
Pyry Kantanen's avatar
Pyry Kantanen committed
36
37
38

### Installation

Pyry Kantanen's avatar
Pyry Kantanen committed
39
Install stable version from CRAN:
Pyry Kantanen's avatar
Pyry Kantanen committed
40

41
```{r install_stable, eval = FALSE}
Pyry Kantanen's avatar
Pyry Kantanen committed
42
43
44
install.packages(hetu)
```

Pyry Kantanen's avatar
Pyry Kantanen committed
45
46
Alternatively, use `devtools` package to install the latest development version from GitHub:

47
```{r install_dev, eval = FALSE}
Pyry Kantanen's avatar
Pyry Kantanen committed
48
devtools::install_github("rOpenGov/hetu")
Pyry Kantanen's avatar
Pyry Kantanen committed
49
50
```

51
52
53
54
55
56
57
58
59
60
61
62
Development version can be also installed using the
[r-universe](https://ropengov.r-universe.dev):

```{r, eval=FALSE}
# Enable this universe
options(repos = c(
  ropengov = "https://ropengov.r-universe.dev",
  CRAN = "https://cloud.r-project.org"
))
install.packages("hetu")
```

Pyry Kantanen's avatar
Pyry Kantanen committed
63
64
### Loading the package and accessing the tutorial

Pyry Kantanen's avatar
Pyry Kantanen committed
65
Loading the package in R command line:
Pyry Kantanen's avatar
Pyry Kantanen committed
66

67
```{r load_library, eval = TRUE}
Pyry Kantanen's avatar
Pyry Kantanen committed
68
69
70
library(hetu)
```

71
A simple example of printing a table containing data from 2 imaginary personal identity codes:
Pyry Kantanen's avatar
Pyry Kantanen committed
72

73
```{r hetu_printout, eval = TRUE}
74
75
example_hetu <- c("010101-0101", "111111-111C")
hetu(example_hetu)
Pyry Kantanen's avatar
Pyry Kantanen committed
76
77
```

78
79
80
81
82
83
84
The package can also be used to check the validity of Finnish Business IDs (Yritys- ja Yhteisötunnus, or Y-tunnus for short):

```{r bid_printout, eval = TRUE}
example_ytunnus <- c("5996039-9", "5619117-6", "6095515-9")
bid_ctrl(example_ytunnus)
```

85
86
87
88
89
90
91
92
93
94
95
A tutorial is included with the package and can be viewed with vignette-function:

```{r vignette, eval = FALSE}
vignette("hetu")
```

## Contributing

  * [Submit suggestions and bug reports](https://github.com/ropengov/hetu/issues) (provide the output of `sessionInfo()` and `packageVersion("hetu")` and preferably provide a [reproducible example](http://adv-r.had.co.nz/Reproducibility.html))
  * [Send a pull request](https://github.com/rOpenGov/hetu/pulls)
  * [Star us on the Github page](https://github.com/ropengov/hetu/)
96
  * [See our website](https://ropengov.org/community/) for additional contact information
97
98

## Acknowledgements
Pyry Kantanen's avatar
Pyry Kantanen committed
99

100
**Kindly cite this work** as follows: [Pyry Kantanen](https://github.com/pitkant/), Måns Magnusson, Jussi Paananen, Leo Lahti. hetu: Finnish personal ID number data toolkit for R. URL: [https://ropengov.github.io/hetu/](https://ropengov.github.io/hetu/)
Pyry Kantanen's avatar
Pyry Kantanen committed
101

102
We are grateful to all [contributors](https://github.com/rOpenGov/hetu/graphs/contributors)! This project is part of [rOpenGov](https://ropengov.org). 
Pyry Kantanen's avatar
Pyry Kantanen committed
103
104
105
106
107

[github-watch-badge]: https://img.shields.io/github/watchers/ropengov/hetu.svg?style=social
[github-watch]: https://github.com/ropengov/hetu/watchers
[github-star-badge]: https://img.shields.io/github/stars/ropengov/hetu.svg?style=social
[github-star]: https://github.com/ropengov/hetu/stargazers