get_unique: Get unique values

Description Usage Arguments Value Author(s) See Also Examples

View source: R/get_unique.R

Description

Creates a data.frame containing columns that uniquely identify a fishery in the cooperatives dataset. By default, it includes original_order, entered_by, fishery_id, geographic_range_of_fishing_acti, and home_port.

Usage

1
2
get_unique(other.variables = NULL, include.spp = TRUE, to.file = FALSE,
  filename = NULL)

Arguments

other.variables

A character string specifying if other variables should be included. See the get_variables function for a list of variables available in cooperatives. If not specified, it defaults to NULL and no additional variables are returned.

include.spp

A logical indicating if the columns for target_spp and complete_name should be included. By default, it is set to TRUE.

to.file

A logical indicating if the extraction should be written to a csv file on disk.

filename

If the to.file argument is set to TRUE, the user may want to specify a particular filename. This must be a character string that specifies the desired name of the file. The user can also specify the directory relative to its current working directory with a customary approach of "./RootFolder/MyDesiredFolder/filename". There is no need to specify file extension! If NULL (de default), the file is saved as cooperatives.csv in the current working directory.

Value

a data.frame containing the desired columns

Author(s)

Juan Carlos

See Also

cooperatives, get_variables

Examples

1
2
3
4
5
# Get unique columns excluding species and save to file
get_unique(include.spp = FALSE, to.file = TRUE)

# Get unique columns, with species, and include \code{support_of_voluntary_regs}and \code{gear_type} columns
get_unique(other.variables = c("support_of_voluntary_regs", "gear_type"))

jcvdav/cooperatR documentation built on May 29, 2019, 1:02 a.m.