Skip to content

Commit 51a99d9

Browse files
committed
improve website (fixes #42)
1 parent 2f1e71b commit 51a99d9

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
not yet on new server (issue #67)
55
* fix issue #65 in `get_taxonlijsten_items()`: return all results in default
66
`feature = '%'`, also results without features
7+
* add documentation on use of package on home page (README)
78

89
# inbodb 0.0.7
910

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,53 @@ To install `inbodb` from GitHub, start a new R session and run this code (before
4141
#install.packages("remotes")
4242
remotes::install_github("inbo/inbodb")
4343
```
44+
45+
# Use `inbodb`
46+
47+
The main function, `connect_inbo_dbase()`, makes a connection to a INBO database by simply providing the database's name as an argument (when connected to the INBO network).
48+
After making this connection, a Connections pane in RStudio shows an overview of the INBO databases, in which database contents can be explored on clicking the icons.
49+
50+
The connection allows to download or query data from the database using functions of packages [DBI](https://dbi.r-dbi.org/) and [dbplyr](https://dbplyr.tidyverse.org/).
51+
Some of the `DBI` functions have extra functionality in `inbodb`, for instance `dbDisconnect()` will also close the Connections pane in RStudio in addition to closing the connection.
52+
Other functions may give more informative errors or (temporarily) fix small technical issues in addition to the DBI functionality, to ensure smooth access to the INBO databases.
53+
54+
Some code examples:
55+
56+
```r
57+
# load packages
58+
library(inbodb)
59+
library(DBI)
60+
61+
# open database connection
62+
con <- connect_inbo_dbase("D0152_00_Flora")
63+
64+
# read a whole table
65+
dbReadTable(con, "Bron")
66+
67+
# query a database using a SQL query
68+
dbGetQuery(con, "SELECT ID, Code, Beschrijving FROM Bron")
69+
70+
# compose a query using R-code and dbplyr
71+
library(dplyr)
72+
tbl(con, "Bron") |>
73+
select("ID", "Code", "Beschrijving") |>
74+
collect()
75+
76+
# close the connection
77+
dbDisconnect(con)
78+
79+
# convert column names of an imported dataset to snake_case
80+
janitor::clean_names(dataset)
81+
```
82+
83+
As databases can be rather complex, we also wrote manuals and functions to easily retain data from some databases:
84+
85+
- [`Florabank`](https://www.vlaanderen.be/inbo/datasets/florabank/) (see description of [functions under 'Reference'](https://inbo.github.io/inbodb/reference/index.html))
86+
- [`INBOveg`](https://www.vlaanderen.be/inbo/datasets/inboveg/) (see `vignette("get_data_inboveg", package = "inbodb")` and [functions](https://inbo.github.io/inbodb/reference/index.html))
87+
- [`meetnetten.be`](https://www.vlaanderen.be/inbo/datasets/meetnettenbe/) (see `vignette("get_data_meetnetten", package = "inbodb")` and [functions](https://inbo.github.io/inbodb/reference/index.html))
88+
- `taxonlijsten` (see `vignette("get_data_taxonlijsten", package = "inbodb")` and [functions](https://inbo.github.io/inbodb/reference/index.html))
89+
90+
Some other databases have functions in a dedicated R package to retain or analyse data, e.g.
91+
92+
- [`LSVIHabitatTypes`](https://inbo.github.io/LSVI/)
93+
- [`watina`](https://inbo.github.io/watina/)

0 commit comments

Comments
 (0)