Skip to content

Commit 2f6a66f

Browse files
committed
🦀
1 parent 5631c8b commit 2f6a66f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+226
-98
lines changed

R/common_names.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' common_to_sci(c("Bicolor cleaner wrasse", "humphead parrotfish"), Language="English")
1616
#' common_to_sci(c("Coho Salmon", "trout"))
1717
#' }
18-
#' @seealso \code{\link{species_list}}, \code{\link{synonyms}}
18+
#' @seealso \code{\link{synonyms}}
1919
#' @export
2020
#' @importFrom dplyr filter select distinct collect
2121
#' @importFrom stringr str_to_lower

R/distribution.R

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Ecosystemname <- NA
2020
#' \dontrun{
2121
#' country("Bolbometopon muricatum")
2222
#' }
23-
#' @details
24-
#' e.g. http://www.fishbase.us/Country
2523
country <- endpoint("country", join = country_names())
2624

2725
#' countrysub
@@ -61,11 +59,7 @@ countrysubref <- function(server = getOption("FISHBASE_API", "fishbase"),
6159
#' @param c_code a C_Code or list of C_Codes (FishBase country code)
6260
#' @export
6361
#' @examplesIf interactive()
64-
#' \dontrun{
6562
#' c_code(440)
66-
#' }
67-
#' @details
68-
#' e.g. http://www.fishbase.us/Country
6963
c_code <- function(c_code = NULL,
7064
server = getOption("FISHBASE_API", "fishbase"),
7165
version = get_latest_release(),
@@ -101,10 +95,7 @@ country_names <- function(server = getOption("FISHBASE_API", "fishbase"),
10195
#' @export
10296
#' @return a tibble, empty tibble if no results found
10397
#' @examplesIf interactive()
104-
#' \dontrun{
10598
#' faoareas()
106-
#' }
107-
#' e.g. http://www.fishbase.us/Country/FaoAreaList.php?ID=5537
10899
faoareas <- function(species_list = NULL, fields = NULL,
109100
server = getOption("FISHBASE_API", "fishbase"),
110101
version = "latest",

R/fb_tbl.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#' Access a fishbase or sealifebase table
22
#'
3+
#'
4+
#' Please note that rfishbase accesses static snapshots of the raw database
5+
#' tables used by FishBase and Sealifebase websites. Because these are static
6+
#' snapshots, they may lag behind the latest available information on the web
7+
#' interface, but should provide stable results.
8+
#'
9+
#' Please also note that the website pages are not organized precisely along
10+
#' the lines of these tables. A given page for a species may draw on data from
11+
#' multiple tables, and sometimes presents the data in a processed or summarized
12+
#' form. Following RDB design, it is often
13+
#' necessary to join multiple tables. Other data cleaning steps are sometimes
14+
#' necessary as well.
315
#' @param tbl table name, as it appears in the database. See [fb_tables()]
416
#' for a list.
517
#' @param server Access data from fishbase or sealifebase?
@@ -25,6 +37,13 @@ fb_tbl <- function(tbl,
2537
out
2638
}
2739

40+
#' List the tables available on fishbase/sealifebase
41+
#'
42+
#' These table names can be used to access each of the corresponding tables
43+
#' using `[fb_tbl()]`. Please note that following RDB design, it is often
44+
#' necessary to join multiple tables. Other data cleaning steps are sometimes
45+
#' necessary as well.
46+
#' @inheritParams fb_tbl
2847
#' @export
2948
#' @examplesIf interactive()
3049
#' fb_tables()

R/load_taxa.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ load_taxa <- memoise::memoise(load_taxa_)
2626

2727

2828

29-
29+
dummy_fn <- function(f) {
30+
# CRAN check doesn't recognize memoise use in the above and throws note:
31+
# Namespace in Imports field not imported from: ‘memoise’
32+
memoise::memoise(f)
33+
}
3034

3135

3236

R/species.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#' @param version a version string for the database. See [available_releases()] for details.
77
#' @param fields subset to these columns. (recommend to omit this and handle manually)
88
#' @param db database connection, now deprecated.
9+
#' @param ... additional arguments, currently ignored
910
#' @return a data.frame with rows for species and columns for the fields returned by the query (FishBase 'species' table)
1011
#' @details
1112
#' The Species table is the heart of FishBase. This function provides a convenient way to

R/synonyms.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ synonyms <- function(species_list = NULL,
5050

5151
df <- data.frame(synonym = species_list, stringsAsFactors = FALSE)
5252
codes <- fb_species(server, version)
53-
left_join(df, syn, by="synonym") %>%
54-
left_join(codes, by = "SpecCode")
53+
dplyr::left_join(df, syn, by="synonym",
54+
relationship = "many-to-many"
55+
) %>%
56+
dplyr::left_join(codes, by = "SpecCode")
5557
}
5658

5759

data/fields.R

Lines changed: 0 additions & 72 deletions
This file was deleted.

man/brains.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/c_code.Rd

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/common_to_sci.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)