FISHeries Indicators: exploratory and descriptive processes of data associated to fisheries
The fishi package is designed to facilitate fisheries and marine science research by providing a set of functions. It aims to simplify common tasks in fisheries research and to improve the efficiency and effectiveness of data analysis and interpretation in this field. It can be used with csv/excel datasets and sql queries.
This version contains a large number of indicators for running the statistical report (https://forge.ird.fr/marbec/ob7/statistical-report) and the RShiny (https://forge.ird.fr/marbec/ob7/rshiny-fishi).
You can install the fishi package directly from GitHub using the devtools package:
devtools::install_github("https://github.com/OB7-IRD/fishi",
INSTALL_opts=c("--no-multiarch"))
To get a bug fix or to use a feature from the development version, you can install the development version of furdeb from GitHub.
devtools::install_github("https://github.com/OB7-IRD/fishi",
ref = "development",
INSTALL_opts=c("--no-multiarch"))
Here is a basic example demonstrating some of the functionalities of the fishi package.
Load data from a CSV file:
Or load data from a SQL database with DBI:
db_connection <- DBI::dbConnect(RMySQL::MySQL(),
dbname = "your_database_name",
host = "your_host",
user = "your_username",
password = "your_password")
query <- "SELECT * FROM your_table"
data <- DBI::dbGetQuery(db_connection, query)
Or load data from a SQL database with furdeb:
db_connection <- DBI::dbConnect(RMySQL::MySQL(),
dbname = "your_database_name",
host = "your_host",
user = "your_username",
password = "your_password")
# anchors informations
ocean <- as.integer(x = 1)
country <- as.integer(x = 1)
report_year <- as.integer(2022)
vessel_type = as.integer(x = c(4, 5, 6))
activity_vessel_type <- furdeb::data_extraction(type = "database",
file_path = system.file("sql",
"balbaya_fishing_activity_vesseltype.sql",
package = "fishi"),
database_connection = balbaya_con,
anchor = list(time_period = time_period,
country = country,
vessel_type = vessel_type,
ocean = ocean))
If you encounter a clear bug, please file an issue with a minimal reproducible example on GitHub issues page. This link is also available if you have any questions and improvement propositions.