-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
79 lines (54 loc) · 2.53 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
---
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%"
)
```
# susR
<!-- badges: start -->
[](https://github.com/Arnold-Kakas/susR/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/Arnold-Kakas/susR)
<!-- badges: end -->
<img src="man/figures/susR_hex.png" align="right" width="160"/>
susR is an R package providing a convenient interface to the Slovak Statistical Office (SUSR) open data API. It simplifies tasks such as:
* Listing available tables.
* Retrieving dimension codes and values for a selected table(s).
* Fetching the data itself in a straightforward manner.
* Returning user-friendly tibbles ready for analysis.
This allows you to explore official Slovak statistical data directly within R, ensuring a reproducible and efficient workflow.
## Installation
You can install the development version of susR from [GitHub](https://github.com/) with:
```{r install, eval = FALSE}
devtools::install_github("Arnold-Kakas/susR")
```
## Example
This is a basic example illustrating how you might use susR to list available tables and fetch dimension values for a specific one.
```{r example, eval = FALSE}
library(susR)
# 1) Retrieve a list of all available tables
tables <- susr_tables()
head(tables)
#> # A tibble: ...
#> # class href table_code ...
#> # <chr> <chr> <chr> ...
#> # ...
# 2) Suppose we want the dimension values for the first table's first dimension:
# We'll pick a table code and a dimension code from the table info
table_code <- tables$table_code[1]
# E.g., "as1001rs" or something similar
dimension_code <- "as1001rs_rok" # Hypothetical dimension code
dim_values <- susr_dimension_values(table_code, dimension_code)
head(dim_values)
#> # A tibble: ...
#> # dimension_code dimension_label dimension_note element_index element_value element_label
#> # ...
```
For more details on additional functions, usage examples, and how to retrieve the actual data, check out the package documentation and [view the vignette](./doc/getting_started.html).
For bugs or feature requests, please open an issue on the GitHub repo.
Happy analyzing with susR!