Type: | Package |
Title: | Exploratory Data Analysis for FishNet2 Data |
Version: | 0.2.0 |
Maintainer: | Kennedy Dorsey <kadorsey97@gmail.com> |
Description: | Provides data processing and summarization of data from FishNet2.net in text and graphical outputs. Allows efficient filtering of information and data cleaning. |
License: | MIT + file LICENSE |
URL: | https://github.com/kdors/rfishnet2 |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 3.6), dplyr (≥ 0.8.3) |
Imports: | pracma (≥ 2.2.5), ggplot2 (≥ 3.2.1), sf (≥ 0.8-0), rworldmap(≥ 1.3-6) |
RoxygenNote: | 7.1.0 |
NeedsCompilation: | no |
Packaged: | 2020-07-26 12:56:04 UTC; kennedy |
Author: | Margaux Armfield email = margaux.armfield@gmail.com [aut], Kennedy Dorsey [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2020-07-26 13:20:02 UTC |
Summarize a set of records downloaded from FishNet2
Description
Creates a simple summary of data returned by a FishNet2 search.
Usage
fishsummary(input, verbose = TRUE)
Arguments
input |
A dataframe in FishNet2 standard format (by using read.csv()) |
verbose |
Print progress and information messages. Default: TRUE |
Value
A list of summary statistics
# summarize occurrence records
Get unique species in a given genus in dataframe.
Description
get_species
returns all species name that correspond to genus name
input in a FishNet2 dataframe.
Usage
get_species(df, genus)
Arguments
df |
A dataframe in FishNet2 standard format (by using read.csv()) |
genus |
Genus of species |
Details
This is a function to get the species name of a given genus name. Names are found using the 'ScientificName' column in a FishNet2 dataframe. If "value is only one word, no species name is returned.
Value
Vector of unique species values or character(0) if empty
Examples
get_species(ictaluridae, "Ameirus")
get_species(ictaluridae, "Noturus")
get_species(louisiana, "Scaphirhynchus")
Filter a set of records downloaded from FishNet2 by Tissue column
Description
Filters data returned by a FishNet2 search for records that include tissue information.
Usage
has_tissue(input, verbose = TRUE)
Arguments
input |
A dataframe in FishNet2 standard format (by using read.csv()) |
verbose |
Print progress and information messages. Default: TRUE |
Value
Filtered dataset with records that do not have a blank tissue value
# summarize occurrence records
Examples
has_tissue(louisiana,TRUE)
Heat Map of Occurrence Frequency by Country
Description
Creates a heatmap of the frequency of an occurrence by country/region.
Usage
heatmap_world(df, name = "none")
Arguments
df |
A dataframe in FishNet2 standard format with column labeled 'Country' |
name |
Value in 'ScientificName' or 'Family' column |
Value
heatmap showing frequency by country
Examples
heatmap_world(ictaluridae)
Dataset of Ictaluridae Taxon from Years 2017 to 2019
Description
A dataset as a result of a search query of taxon 'Ictaluridae' and date range '2017-2019' on fishnet2.net
Usage
ictaluridae
Format
A data frame with 273 rows and 16 variables:
- InstitutionCode
unique code given to institution who owns the data
- IndividualCount
Number of fish individuals
- ScientificName
Scientific name of fish observation
- Family
Family of fish observation
- PreparationType
Type of preparation
- Tissues
Whether observation contains tissues
- Latitude
Latitude observed
- Longitude
Longitude observed
- Country
Country that lot was observed in
- StateProvince
State or province where lot was observed
- County
County that lot was observed in
- YearCollected
Year collected
- MonthCollected
Month collected
- DayCollected
Day collected
- BasisOfRecord
Preserved Specimen
- DateLastModified
Data record last modified in database
Source
http://www.fishnet2.net/search.aspx?t=ictaluridae&d=2017-2019
Dataset of Records from Louisiana from Years 2005 to 2006
Description
A dataset as a result of a search query of location 'Louisiana' and date range '2005-2006' on fishnet2.net
Usage
louisiana
Format
A data frame with 273 rows and 20 variables:
- InstitutionCode
unique code given to institution who owns the data
- CollectionCode
Collection Code
- IndividualCount
Number of fish individuals
- ScientificName
Scientific name of fish observation
- Family
Family of fish observation
- PreparationType
Type of preparation
- Tissues
Whether observation contains tissues
- Latitude
Latitude observed
- Longitude
Longitude observed
- HorizontalDatum
Horizontal Datum
- Country
Country that lot was observed in
- StateProvince
State or province where lot was observed
- County
County that lot was observed in
- YearCollected
Year collected
- MonthCollected
Month collected
- DayCollected
Day collected
- Collector
Name of collector
- GeorefMethod
Geo Reference Method
- BasisOfRecord
Preserved Specimen
- DateLastModified
Data record last modified in database
Source
http://www.fishnet2.net/search.aspx?l=+Louisiana&d=2005-2006
Plot Longitude and Latitude Points on World Map
Description
occ_map
returns a plot with columns 'Longitude' and 'Latitude' in FishNet2
dataframe on a world map.
Usage
occ_map(df, color = "darkred")
Arguments
df |
A dataframe in FishNet2 standard format (by using read.csv()) |
color |
Color of plotted points, default is dark red |
Details
This is a function to get a plot of occurrence records from FishNet2 search query. Parameter is a dataframe that must have the columns 'Longitude' and 'Latitude'. NA values are removed in the function.
Value
Plot of latitude and longitude points on world map
Examples
occ_map(ictaluridae)
Plots record count by Scientific Name on a bar graph.
Description
plot_records
returns a bar graph showing the number of records for each distinct
scientific name in the dataset.
Usage
plot_records(df, top_ten = TRUE, color = TRUE)
Arguments
df |
A dataframe in FishNet2 standard format (by using read.csv()) |
top_ten |
Top ten species occurrence counts |
color |
True if each bar should have a distinct color, FALSE for grey bars. Default: TRUE |
Details
This is a function to visualize data by Scientific Name from FishNet2 search query. A dataframe is input from a standard FishNet2 search query.
Value
Plot of record count by Scientific Name on a bar graph
Examples
plot_records(louisiana)
Filter data by longitude and latitude.
Description
spatialsearch
returns the data that falls within radius given radius,
and latitude and longitude coordinates.
Usage
spatial_search(df, lat, lon, r)
Arguments
df |
A dataframe in FishNet2 standard format (by using read.csv()) |
lat |
Latitude coordinate |
lon |
Longitude coordinate |
r |
Radius in kilometers |
Details
This is a function to filter data given in the format of a csv file from FishNet2. For this to work properly, the dataframe must have column names using names given in standard csv format from FishNet2 website.
Value
Rows in file that fall within circle with center (lat,long) and radius r
Examples
spatial_search(ictaluridae, 36.12, -77.63, 1)
## Not run:
spatial_search(ictaluridae, -173,44,10)
## End(Not run)
Outputs a bar graph giving the top n in frequency in specified column of dataframe
Description
top_n_plots
returns a bar graph that shows the top n (n is given as a
parameter) labels in a given column in the dataframe with the highest
frequency
Usage
top_n_plots(df, n, colName, color = "default colors")
Arguments
df |
A dataframe in FishNet2 standard format (by using read.csv()) |
n |
The number of the labels with the highest frequencies to be included in the graph |
colName |
The column name that the graph outputs |
color |
Color of the bars, by default is a different color for each bar |
Details
This is a function to create and output a bar graph giving the top n in frequency in specified column of dataframe (columns include 'ScientificName', 'Family', 'Country','State/Province','County').
Value
A bar graph
Examples
top_n_plots(ictaluridae,10,"ScientificName")