knitr::opts_chunk$set(echo = FALSE, message = FALSE) library(gfsR) # due to plyr namespace conflicts gfsR needs to be loaded before dplyr library(glfishr) library(httr) library(jsonlite) library(dplyr) fn011 <- get_FN011(list(prj_cd = params$prj_cd)) fn121 <- get_FN121(list(prj_cd = params$prj_cd)) fn123 <- get_FN123(list(prj_cd = params$prj_cd)) fn123 <- append.spc.names(fn123) fn125 <- get_FN125(list(prj_cd = params$prj_cd)) prj<- get_pt_projects(list(prj_cd = params$prj_cd)) prj_ldr <- paste(prj$PRJ_LDR.FIRST_NAME, prj$PRJ_LDR.LAST_NAME, sep =" ") prj_abstract <- prj$ABSTRACT
n_nets <- nrow(fn121) n_sites <- length(unique(fn121$SITE)) n_species <- length(unique(fn123$SPC)) mn_effdur <- round(mean(fn121$EFFDUR), 1) min_effdur <- round(min(fn121$EFFDUR),1) max_effdur <- round(max(fn121$EFFDUR), 1) min_SIDEP <- round(min(fn121$SIDEP), 1) max_SIDEP <- round(max(fn121$SIDEP), 1) min_SITEM <- round(min(fn121$SITEM), 1) max_SITEM <- round(max(fn121$SITEM), 1) spc_sum <- fn123 |> group_by(SPC) |> summarize(N = sum(CATCNT)) spc_sum <- append.spc.names(spc_sum) spc_sum <- arrange(spc_sum, desc(N))
r fn011$PRJ_NM
r params$prj_cd
r prj_ldr
r fn011$PRJ_DATE0
r fn011$PRJ_DATE1
r prj_abstract
The project had r n_nets
net tows at r n_sites
r ifelse(n_sites == 1, "location", "locations")
. The average effort duration was r mn_effdur
hours (range: r min_effdur
- r max_effdur
hours). Tows were conducted at site depths ranging from r min_SIDEP
m to r max_SIDEP
m and surface temperatures ranging from r min_SITEM
$^\circ$C to r max_SITEM
$^\circ$C.
There were r n_species
species and r sum(fn123$CATCNT)
fish caught over the duration of this project, r sum(fn123$BIOCNT)
of which were bio sampled. The majority of species caught were r spc_sum$SPC_NM[1]
(n=r spc_sum$N[1]
), followed by r spc_sum$SPC_NM[2]
(n=r spc_sum$N[2]
) and r spc_sum$SPC_NM[3]
(n=r spc_sum$N[3]
)
library(leaflet) fn121 <- fn121 |> mutate(maplabel = paste("SAM:", SAM, sep = " ")) leaflet(fn121) |> addTiles() |> addCircles(lat = ~DD_LAT, lng = ~DD_LON, popup = ~maplabel)
library(knitr) library(kableExtra) catch_sum <- fn123 |> group_by(SPC_LAB) |> summarize(CATCNT = sum(CATCNT, na.rm = T), BIOCNT = sum(BIOCNT)) |> arrange(desc(CATCNT)) catch_sum[1:10,] |> knitr::kable(caption = "Table 1. Top 10 species captured.",) |> kable_paper(bootstrap_options = "striped", full_width = F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.