Package 'pssp'

Title: Package to interface with the WDFW Puget Sound sampling database
Description: The pssp package serves as an interface between R and the Puget Sound sampling database. It"s goal is to ease the burden of retrieving and analyzing sport creel information in Puget Sound.
Authors: Ty Garber [aut, cre]
Maintainer: Ty Garber <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0
Built: 2024-12-22 06:20:11 UTC
Source: https://github.com/FRAMverse/pssp

Help Index


Add timestep columns to a dataframe

Description

Adds a time step column to a dataframe

Usage

add_time_steps(
  .data,
  date_column = "survey_datetime",
  species = c("chinook", "coho")
)

Arguments

.data

dataframe

date_column

Column of the datetime

species

Species, either chinook or coho

Examples

## Not run: 
df |> add_time_steps()

## End(Not run)

Aerial Estimator Table

Description

Finds in-sample boats during the flight and calculates various numbers from it

Usage

aerial_estimator(catch_area, start_date, end_date)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

See Also

Other Aerial Effort Surveys: aerial_estimator_stats(), aerial_pull()

Examples

## Not run: df <- aerial_estimator('07', '2021-07-01', '2021-07-07')

Aerial Estimator Table

Description

Calculaties the adjusted proportion and variance of the aerial estimator table

Usage

aerial_estimator_stats(.data, bad_flights = FALSE)

Arguments

.data

Dataframe

bad_flights

Throws out flights where there were more boats sampled at the dock than see from the air

See Also

Other Aerial Effort Surveys: aerial_estimator(), aerial_pull()

Examples

## Not run: df <- aerial_estimator('07', '2021-07-01', '2021-07-07')
df |>
      aerial_estimator_stats()
      
## End(Not run)

Aerial data pull

Description

Pulls the aerial data

Usage

aerial_pull(
  catch_area,
  start_date,
  end_date,
  fresh = FALSE,
  check_fresh = TRUE
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

fresh

Boolean. Ensures data is updated

check_fresh

Boolean. Checks whether data is current

See Also

Other Aerial Effort Surveys: aerial_estimator(), aerial_estimator_stats()

Examples

## Not run: df <- aerial_pull('07', '2021-07-01', '2021-07-07')

Effort map

Description

Provides a heat map of angling effort

Usage

bs_map(.data, blur = 25, max = 0.05, radius = 10)

Arguments

.data

Dataframe

blur

Inherited argument from leaflet

max

Inherited argument from leaflet

radius

Inherited argument from leaflet

See Also

Other Boat Effort Surveys: bs_pull(), bs_site_weights(), bs_site_weights_in(), bs_site_weights_out()

Examples

## Not run: bs_data |> bs_map()

Downloads test fishing data from pssp

Description

Queries RMIS for release infomation, defaults to tagged releases

Usage

bs_pull(
  catch_area,
  start_date,
  end_date,
  fresh = FALSE,
  check_fresh = TRUE,
  dsn = "pssp_prod64"
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

fresh

Boolean. Ensures data is updated

check_fresh

Boolean. Checks whether data is current

dsn

DSN for the database connection. Default 'pssp_prod64'

See Also

Other Boat Effort Surveys: bs_map(), bs_site_weights(), bs_site_weights_in(), bs_site_weights_out()

Examples

## Not run: bs_data <- bs_pull('10', '2021-11-01', '2021-12-04')

Calculates site weights

Description

Calculates site weights

Usage

bs_site_weights(.data, sample_type = c("in_sample", "out_sample"))

Arguments

.data

Dataframe

sample_type

Return in sample site weights or out of sample site weights

See Also

Other Boat Effort Surveys: bs_map(), bs_pull(), bs_site_weights_in(), bs_site_weights_out()

Examples

## Not run: bs_data |> bs_site_weights(sample_type = 'in_sample')
## Not run: bs_data |> bs_site_weights(sample_type = 'out_sample')

Calculates in-sample site weights

Description

Calculates in-sample site weights

Usage

bs_site_weights_in(.data)

Arguments

.data

Dataframe

See Also

Other Boat Effort Surveys: bs_map(), bs_pull(), bs_site_weights(), bs_site_weights_out()

Examples

## Not run: bs_data |> bs_site_weights_in()

Calculates out-of-sample site weights

Description

Calculates out-of-sample site weights

Usage

bs_site_weights_out(.data)

Arguments

.data

Dataframe

See Also

Other Boat Effort Surveys: bs_map(), bs_pull(), bs_site_weights(), bs_site_weights_in()

Examples

## Not run: bs_data |> bs_site_weights_out()

Total length calculation for fork length

Description

Adds StatWeek to Dataframe

Usage

calculate_total_length(
  .data,
  fork_length_column = "fork_length",
  size_class = TRUE,
  minimum_size_limit_inches = 22
)

Arguments

.data

Dataframe

fork_length_column

Column name of fork lengths provided

size_class

Adds size class column (sublegal and legal)

minimum_size_limit_inches

Size limit (total length) of fishery in inches

Examples

## Not run: 
df |> calculate_total_length()

## End(Not run)

Checks if data is current

Description

Checks if data is current, if it is then updates, if not passes through

Usage

check_freshness(days = 3)

Arguments

days

The number of days to check with the last update of the materialized views

Examples

## Not run: 
check_freshness()

## End(Not run)

Pulls a biological infomartion

Description

Pulls lengths and cwts from dockside information

Usage

ds_bio_pull(
  catch_area,
  start_date,
  end_date,
  int_dates = FALSE,
  fill_zero = FALSE,
  check_fresh = TRUE,
  fresh = FALSE
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of

int_dates

Returns year, month, day integer columns instead of a date field

fill_zero

Fills NA's with zeros

check_fresh

Boolean. Checks whether data is current

fresh

Boolean. Ensures data is updated

See Also

Other Dockside Creel Surveys: ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: ds_bio_data <- ds_bio_pull('10', '2021-11-01', '2021-12-04')
## Not run: ds_bio_data <- ds_bio_pull(c('10', '09'), '2021-11-01', '2021-12-04')

Pulls the dockside encounters

Description

Pulls Dockside Encounters

Usage

ds_encounters(
  catch_area,
  start_date,
  end_date,
  pretty = TRUE,
  bias_corrected = TRUE,
  minimum_size_limit_inches = 22
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

pretty

If TRUE will return a summarized dataframe, if FALSE will return a list to be used in other calculations

bias_corrected

Will return proportions with bias correction

minimum_size_limit_inches

Minimum size limit for fishery

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: dockside_encounters <- ds_encounters('10', '2021-11-01', '2021-12-04')

In-Sample filter

Description

Filters to in sample locations with study design input

Usage

ds_filter_insample(.data, design = c("murthy", "aerial"))

Arguments

.data

Dataframe

design

Either murthy or aerial

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: df |> ds_filter_insample(design = 'murthy')

In-Sample filter (Aerial)

Description

Filters to in sample locations with a Aerial study design

Usage

ds_filter_insample_aerial(.data)

Arguments

.data

Dataframe

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: df |> ds_filter_insample_aerial()

In-Sample filter (Murthy)

Description

Filters to in sample locations with a Murthy study design

Usage

ds_filter_insample_murthy(.data)

Arguments

.data

Dataframe

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: df |> ds_filter_insample_murthy()

Makes a chart comparing current year CPUE vs previous years

Description

Makes a chart comparing current year CPUE vs previous years

Usage

ds_historical_cpue_chart(
  catch_area,
  start_date,
  end_date,
  species = c("chinook", "coho", "pink"),
  smoothing_method = "loess",
  clipped_only = T
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

species

Species to look for - chinook, pink, coho

smoothing_method

Default loess. Takes method arguments from geom_smooth

clipped_only

Will use only ad clipped fish

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: ds_historical_cpue_chart('10', '2021-11-01', '2021-12-04')
## Not run: ds_historical_cpue_chart('10', '2021-11-01', '2021-12-04') + ggtitle('New Title')

Get sampling effort data

Description

Gets effort data for our dockside sampling

Usage

ds_pull_sampling_effort(marine_area, start_date, end_date)

Arguments

marine_area

Valid marine area code

start_date

Start date of search

end_date

End date of search

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: df <- ds_pull_sampling_effort('10', '2021-01-01', '2021-12-31')

Pulls release information for chinook and coho with legal size status

Description

Pulls release information for chinook and coho with legal size status

Usage

ds_releases_pull(
  catch_area,
  start_date,
  end_date,
  int_dates = FALSE,
  fill_zero = FALSE,
  check_fresh = TRUE,
  fresh = FALSE
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

int_dates

Returns year, month, day integer columns instead of a date field

fill_zero

Boolean. Fills NA's with zeros.

check_fresh

Boolean. Checks whether data is current

fresh

Boolean. Ensures data is updated

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: ds_rel_data <- ds_releases_pull('10', '2021-11-01', '2021-12-04')
## Not run: ds_rel_data <- ds_releases_pull(c('10', '09'), '2021-11-01', '2021-12-04')

Downloads test fishing data from pssp

Description

Queries RMIS for release infomation, defaults to tagged releases

Usage

ds_salmon_summary(
  catch_area,
  start_date,
  end_date,
  int_dates = FALSE,
  fill_zero = FALSE,
  fresh = FALSE,
  check_fresh = TRUE,
  dsn = "pssp_prod64"
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

int_dates

Returns year, month, day integer columns instead of a date field

fill_zero

Fill NA's with zeros.

fresh

Boolean. Ensures data is updated

check_fresh

Boolean. Checks whether data is current

dsn

DSN for the database connection. Default 'pssp_prod64'

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: ds_data <- ds_salmon_summary('10', '2021-11-01', '2021-12-04')
## Not run: ds_data <- ds_salmon_summary(c('11','10'), '2021-11-01', '2021-12-04')

Sampling effort summary with added sampler

Description

Gets effort data and summarizes by survey trips and survey hours by sampler

Usage

ds_sampling_effort_sampler_summary(marine_area, start_date, end_date)

Arguments

marine_area

Valid marine area code

start_date

Start date of search

end_date

End date of search

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: df <- ds_sampling_effort_sampler_summary('10', '2021-01-01', '2021-12-31')

Sampling effort summary

Description

Gets effort data and summarizes by survey trips and survey hours

Usage

ds_sampling_effort_summary(marine_area, start_date, end_date)

Arguments

marine_area

Valid marine area code

start_date

Start date of search

end_date

End date of search

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), identify_in_sample(), marine_pull()

Examples

## Not run: df <- ds_sampling_effort_summary('10', '2021-01-01', '2021-12-31')

In-Sample idenifier

Description

Identifys in-sample locations by adding in_sampling column

Usage

identify_in_sample(
  .data,
  location_code_column = "location_code",
  design = c("murthy", "aerial"),
  named = FALSE
)

Arguments

.data

Dataframe

location_code_column

The column in dataframe where the location codes are.

design

Either murthy or aerial

named

Boolen. Returns a column of in/out of sample.

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), marine_pull()

Examples

## Not run: df |> identify_in_sample(design = 'murthy')

Vectorized approach to calculating the management week, returns an integer

Description

Vectorized approach to calculating the management week, returns an integer

Usage

management_week(date)

Arguments

date

A column with dates

Examples

## Not run: 
data_frame |>
  mutate(mngmt_week = management_week(date_field))

## End(Not run)

Pulls non-salmon related data

Description

Queries dockside information from pssp_dev

Usage

marine_pull(
  catch_area,
  start_date,
  end_date,
  int_dates = FALSE,
  fill_zero = FALSE,
  fresh = FALSE,
  check_fresh = TRUE
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

int_dates

Returns year, month, day integer columns instead of a date field

fill_zero

Fill NA's with zeros.

fresh

Boolean. Ensures data is updated

check_fresh

Boolean. Checks whether data is current

See Also

Other Dockside Creel Surveys: ds_bio_pull(), ds_encounters(), ds_filter_insample(), ds_filter_insample_aerial(), ds_filter_insample_murthy(), ds_historical_cpue_chart(), ds_pull_sampling_effort(), ds_releases_pull(), ds_salmon_summary(), ds_sampling_effort_sampler_summary(), ds_sampling_effort_summary(), identify_in_sample()

Examples

## Not run: marine_pull <- marine_pull('10', '2021-11-01', '2021-12-04')
## Not run: marine_pull <- marine_pull(c('10', '09'), '2021-11-01', '2021-12-04')

Gets the last time materialized views we updated

Description

Gets the last time materialized views were updated

Usage

pssp_last_update(dsn = "pssp_prod64")

Arguments

dsn

DSN connection default "pssp_prod64"

Examples

## Not run: 
pssp_last_update()

## End(Not run)

Queries the pssp database

Description

Queries the pssp database and returns a tibble

Usage

pssp_query(query, dsn = "pssp_prod64")

Arguments

query

SQL Query

dsn

DSN connection default "pssp_prod64"

Examples

## Not run: 
data <- pssp_query("SELECT * FROM survey LIMIT 10;")

## End(Not run)

Refreseshs datasources

Description

Refreshes all materialized views

Usage

pssp_refresh_data(dsn = "pssp_prod64")

Arguments

dsn

DSN connection default "pssp_prod64"

Examples

## Not run: 
pssp_refresh_data()

## End(Not run)

Vectorized approach to calculating the statistical week, returns an integer

Description

Statistical weeks start on mondays, so the first statistical week of the year starts on the first monday of the year. (Contrast with management weeks which start on Sundays).

Usage

statistical_week(date)

Arguments

date

A vector of dates

Examples

## Not run: 
data_frame |>
  mutate(stat_week = statistical_week(date_field))

## End(Not run)

CV of Legal Marked Category

Description

Coefficient of legal mark category

Usage

tf_cv(.data, category = "Legal_AD")

Arguments

.data

Dataframe

category

Legal mark category (LM Default)

See Also

Other Test Fishing: tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: 
tf_data |> tf_cv(Legal_AD)

## End(Not run)

Descriptive statistics of lengths

Description

Mean, sum, and count of lengths by adipose clip

Usage

tf_descriptive_length(.data, length_type = "total_length")

Arguments

.data

Dataframe

length_type

total_length or fork_length

See Also

Other Test Fishing: tf_cv(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: 
tf_data |> tf_descriptive_length(total_length)

## End(Not run)

Test Fishing Weekly Effort

Description

Produces a table of weekly effort in surveys and hours

Usage

tf_effort_summary_week(.data, date_column)

Arguments

.data

Dataframe

date_column

Column to calculate stat week, usually survey_datetime

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: tf_data |> tf_effort_summary_week()

Test fishing length histogram

Description

Identifies agency based on sampler name

Usage

tf_hist(
  .data,
  x_axis,
  x_label = "Total Length (CM)",
  y_label = "Count",
  title = "Chinook Test Fishing Lengths"
)

Arguments

.data

Dataframe

x_axis

Length column. total_length or fork_length

x_label

Label of x axis

y_label

Label of y axis

title

Title of plot

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: 
tf_data |> tf_hist(total_length)

## End(Not run)

Interagency Fisher / Chi Square Test

Description

Fisher / Chi Square test between agencies and legal mark counts

Usage

tf_interagency_chisq(.data, significance = 0.05)

Arguments

.data

Dataframe

significance

Significance threshold default .05

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: tf_data |> tf_interagency_chisq()

Histogram comparison between agencies by length

Description

Histogram

Usage

tf_interagency_histogram(
  .data,
  x_axis,
  x_label = "Total Length (CM)",
  y_label = "Count",
  title = "Interagency Lengths"
)

Arguments

.data

Dataframe

x_axis

Length column. total_length or fork_length

x_label

Label of x axis

y_label

Label of y axis

title

Title of plot

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: tf_data |> tf_interagency_histogram(total_length, agency)

Iteragency legal mark summary

Description

Summary of encounters by agency and legal mark category

Usage

tf_interagency_lm_summary(.data, percent = FALSE)

Arguments

.data

Dataframe

percent

Boolean. Results will be displayed in terms of percentage

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: tf_data |> tf_interagency_lm_summary()

Iteragency summary

Description

Summary of effort and encounters by agency

Usage

tf_interagency_summary(.data)

Arguments

.data

Dataframe

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: 
tf_data |> tf_interagency_summary()

## End(Not run)

Summarize by Legal Mark category

Description

Creates a summary data with counts by legal mark category

Usage

tf_lm_summary(.data, size_limit = 22)

Arguments

.data

Dataframe

size_limit

Size limit in inches to be used to find legality. Default 22 inchees

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: 
tf_data |> tf_lm_summary()

## End(Not run)

Test Fishing Weekly encounters

Description

Produces a table of weekly encounters by legal mark category

Usage

tf_lm_summary_week(.data, date_column)

Arguments

.data

Dataframe

date_column

Column to calculate stat week, usually survey_datetime

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: tf_data |> tf_lm_summary_week()

Map of test fishing encouners

Description

This produces a leaflet map showing test fishing encounters

Usage

tf_map(.data, ...)

Arguments

.data

Dataframe

...

add_effort = TRUE, Adds a heat map of boat surveys. start_date, end_date and catch_area must also be supplied

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: tf_data |> tf_map()

Mortality ratio

Description

Produces a graph

Usage

tf_mortalility(.data)

Arguments

.data

Dataframe

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_pull(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: 
tf_data |> tf_interagency_lm_summary()

## End(Not run)

Downloads test fishing data from pssp

Description

Queries pssp for test fishing encounters

Usage

tf_pull(
  catch_area,
  start_date,
  end_date,
  fresh = FALSE,
  check_fresh = TRUE,
  dsn = "pssp_prod64"
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

fresh

Boolean. Ensures data is updated

check_fresh

Boolean. Checks whether data is current

dsn

DSN for the database connection. Default 'pssp_prod64'

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pvalue_history(), tf_scatter(), tf_summary()

Examples

## Not run: 
tf_data <- tf_pull("10", "2021-11-01", "2021-12-04")

## End(Not run)

Line plot of p-values from Chi-square

Description

Line plot of cummulative p-values yieled from cummulative totals of test fishing encounters

Usage

tf_pvalue_history(.data, alpha = 0.05)

Arguments

.data

Dataframe

alpha

Significance metric to evaluate whether statistically sigificant or not

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_scatter(), tf_summary()

Examples

## Not run: tf_data |> tf_pvalue_history()

Creates a ggplot scatter plot of test fishing lengths by adipose clip

Description

Queries RMIS for release infomation, defaults to tagged releases

Usage

tf_scatter(
  .data,
  x_axis,
  y_axis,
  x_label = "Survey Date",
  y_label = "Total Length (CM)",
  title = "Chinook Test Fishing Lengths"
)

Arguments

.data

Dataframe

x_axis

Variable for x axis of plot

y_axis

Variable for y axis of plot

x_label

Label of x axis

y_label

Label of y axis

title

Title of plot

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_summary()

Examples

## Not run: 
tf_data |> tf_scatter(survey_datetime, total_length)

## End(Not run)

Test Fishing Weekly Summary

Description

Produces a table summarizing test fishing effort and encounters

Usage

tf_summary(.data, date_column)

Arguments

.data

Dataframe

date_column

Column to calculate stat week, usually survey_datetime

See Also

Other Test Fishing: tf_cv(), tf_descriptive_length(), tf_effort_summary_week(), tf_hist(), tf_interagency_chisq(), tf_interagency_histogram(), tf_interagency_lm_summary(), tf_interagency_summary(), tf_lm_summary(), tf_lm_summary_week(), tf_map(), tf_mortalility(), tf_pull(), tf_pvalue_history(), tf_scatter()

Examples

## Not run:  tf_data |> tf_summary()

Downloads VTR data from pssp

Description

Queries RMIS for release infomation, defaults to tagged releases

Usage

vtr_pull(
  catch_area,
  start_date,
  end_date,
  pretty = TRUE,
  fresh = FALSE,
  check_fresh = TRUE
)

Arguments

catch_area

Valid catch area code

start_date

Start date of search

end_date

End date of search

pretty

Returns an easily readable dataframe

fresh

Boolean. Ensures data is updated

check_fresh

Boolean. Checks whether data is current

Value

Dataframe

Examples

## Not run: vtr_data <- vtr_pull('10', '2021-11-01', '2021-12-04')