Skip to contents

A small creel interview data frame with intentional data quality issues for demonstrating validate_creel_data() and standardize_species(). Includes an empty species string, a negative fish_kept value, and a missing trip_hours value.

Usage

creel_interviews_toy

Format

A data frame with 6 rows and 5 columns:

date

Interview date (Date class).

day_type

Day type stratum: "weekday" or "weekend".

species

Free-text species name; includes empty string and unrecognised value to demonstrate standardize_species() behaviour.

fish_kept

Number of fish kept; one row is intentionally negative.

trip_hours

Trip duration in hours; one row is intentionally NA.

Source

Simulated data for package examples and vignettes.

Examples

data(creel_interviews_toy)
validate_creel_data(interviews = creel_interviews_toy)
#> 
#> ── Creel Data Validation ───────────────────────────────────────────────────────
#> 12 pass | 2 warn | 1 fail
#> 
#> 
#> ── Table: interviews ──
#> 
#>  date
#> ✔ type: class: Date
#> ✔ na_rate: 0 / 6 NA (0%)
#> ✔ date_range: all within 1970-01-01 - 2100-12-31
#>  day_type
#> ✔ type: class: character
#> ✔ na_rate: 0 / 6 NA (0%)
#> ✔ empty_strings: none
#> ! species
#> ✔ type: class: character
#> ✔ na_rate: 0 / 6 NA (0%)
#> ⚠ empty_strings: 1 empty string(s)
#>  fish_kept
#> ✔ type: class: integer
#> ✔ na_rate: 0 / 6 NA (0%)
#> ✖ negative_values: 1 negative value(s)
#> ! trip_hours
#> ✔ type: class: numeric
#> ⚠ na_rate: 1 / 6 NA (17%)
#> ✔ negative_values: none
#> 
standardize_species(creel_interviews_toy, species_col = "species")
#> Warning: 2 species value(s) could not be matched to an
#> AFS code and will be "NA":
#>  ""
#>  "UNKNOWN FISH"
#>         date day_type         species fish_kept trip_hours species_code
#> 1 2024-06-01  weekday         walleye         2        3.5          WAE
#> 2 2024-06-01  weekday Largemouth Bass         0        2.0          LMB
#> 3 2024-06-02  weekend                         1         NA         <NA>
#> 4 2024-06-03  weekday        bluegill        -1        4.0          BLG
#> 5 2024-06-08  weekend   northern pike         3        1.5          NOP
#> 6 2024-06-09  weekday    UNKNOWN FISH         0        6.0         <NA>