You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to `rfishbase 5`! This is the fourth rewrite of the original `rfishbase` package described in [Boettiger et al. (2012)](https://doi.org/10.1111/j.1095-8649.2012.03464.x).
16
17
17
18
18
-
Welcome to `rfishbase 4`. This is the fourth rewrite of the original `rfishbase` package described in [Boettiger et al. (2012)](https://doi.org/10.1111/j.1095-8649.2012.03464.x).
19
+
Another streamlined re-design following new abilities for data hosting and access.
20
+
This release relies on a HuggingFace datasets hosting for data and metadata hosting
21
+
in parquet and schema.org.
22
+
23
+
Data access is simplified to use the simple HuggingFace datasets API instead
24
+
of the previous contentid-based resolution. This allows metadata to be defined
25
+
with directly alongside the data platform independent of the R package.
26
+
27
+
A simplified access protocol relies on `duckdbfs` for direct reads of tables.
28
+
Several functions previously used only to manage connections are now deprecated
29
+
or removed, along with a significant number of dependencies.
30
+
31
+
Core use still centers around the same package API using the `fb_tbl()` function,
32
+
with legacy helper functions for common tables like `species()` are still accessible and
33
+
can still optionally filter by species name where appropriate. As before, loading the
34
+
full tables and sub-setting manually is still recommended.
35
+
36
+
Historic helper functions like `load_taxa()` (combining the taxonomic classification from Species,
37
+
Genus, Family and Order tables), `validate_names()`, and `common_to_sci()` and
38
+
`sci_to_common()` should be in working order, all using table-based outputs.
39
+
19
40
20
41
-`rfishbase 1.0` relied on parsing of XML pages served directly from Fishbase.org.
21
42
-`rfishbase 2.0` relied on calls to a ruby-based API, `fishbaseapi`, that provided access to SQL snapshots of about 20 of the more popular tables in FishBase or SeaLifeBase.
@@ -91,61 +112,6 @@ available_releases()
91
112
```
92
113
93
114
94
-
95
-
## Low-memory environments
96
-
97
-
If you have very limited RAM (e.g. <= 1 GB available) it may be helpful to use `fishbase` tables in remote form by setting `collect = FALSE`. This allows the tables to remain on disk, while the user is still able to use almost all `dplyr` functions (see the `dbplyr` vignette). Once the table is appropriately subset, the user will need to call `dplyr::collect()` to use generic non-dplyr functions, such as plotting commands.
98
-
99
-
```{r}
100
-
fb_tbl("occurrence")
101
-
```
102
-
103
-
104
-
## Local copy
105
-
106
-
Set the option "rfishbase_local_db" = TRUE to create a local copy, otherwise will use a remote copy.
107
-
Local copy will get better performance after initial import, but may experience conflicts when
108
-
`duckdb` is upgraded or when multiple sessions attempt to access the directory. Remove the default
109
-
storage directory (given by `db_dir()`) after upgrading duckdb if using a local copy.
110
-
111
-
```{r}
112
-
options("rfishbase_local_db" = TRUE)
113
-
db_disconnect() # close previous remote connection
114
-
115
-
conn <- fb_conn()
116
-
conn
117
-
```
118
-
119
-
Users can trigger a one-time download of all fishbase tables (or a list of desired tables) using `fb_import()`. This will ensure later use of any function can operate smoothly even when no internet connection is available. Any table already downloaded will not be re-downloaded. (Note: `fb_import()` also returns a remote duckdb database connection to the tables, for users who prefer to work with the remote data objects.)
120
-
121
-
```{r}
122
-
fb_import()
123
-
```
124
-
125
-
126
-
127
-
```{r include=FALSE}
128
-
db_disconnect(conn)
129
-
```
130
-
131
-
132
-
133
-
## Interactive RStudio pane
134
-
135
-
RStudio users can also browse all fishbase tables interactively in the RStudio connection browser by using the function `fisbase_pane()`. Note that this function will first download a complete set of the fishbase tables.
136
-
137
-
## Backwards compatibility
138
-
139
-
140
-
`rfishbase` 4.0 tries to maintain as much backwards compatibility as possible with rfishbase 3.0. Because parquet preserves native data types, some encoded types may differ from earlier versions. As before, these are not always the native type -- e.g. fishbase encodes some boolean (logical TRUE/FALSE) values as integer (-1, 0) or character types. Use `as.logical()` to coerce into the appropriate type in that case.
141
-
142
-
Toggling between fishbase and sealifebase servers using an environmental variable, `FISHBASE_API`, is now deprecated.
143
-
144
-
Note that fishbase will store downloaded files by hash in the app directory, given by `db_dir()`. The default location can be set by configuring the desired path in the environmental variable, `FISHBASE_HOME`.
145
-
146
-
147
-
148
-
149
115
-----------
150
116
151
117
Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.
0 commit comments