Skip to content

Commit

Permalink
2024 data added
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Aug 29, 2024
1 parent d11e63e commit 9b3f478
Show file tree
Hide file tree
Showing 15 changed files with 1,852 additions and 1,071 deletions.
48 changes: 43 additions & 5 deletions R/dat_proc.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,41 @@ fls <- drive_ls(gdrive_pth, type = 'spreadsheet')

# format google drive data --------------------------------------------------------------------

# 2024 data -----------------------------------------------------------------------------------

id <- fls[grep('Scallop_Search_2024', fls$name), 'id'] %>% pull(id)

rawdat <- read_sheet(id)

# hex as zero means corrected hex was outside of boundaries, entries retained for total boat count
cntdat2024 <- rawdat %>%
filter(!is.na(`OBJECTID`)) %>%
select(
id = `Boat Captain`,
hexorig = `Hexagon Number from Submitted Survey`,
hex = `Updated Hex # Post Review`,
`Scallops found` = `Scallops`
) %>%
mutate(
id = as.numeric(factor(id)),
hex = case_when(
hex == 0 & id == 21 ~ 83, # these were corrected hex numbers that were outside, but contained scalloped, used original hex
hex == 0 & id == 11 ~ 56,
T ~ hex
)
) %>%
select(-hexorig) %>%
mutate(
Site = 1:n(),
.by = id
) %>%
mutate(
yr = 2024,
Site = paste0('Site', Site)
) %>%
select(yr, everything()) %>%
arrange(id, Site)

# 2023 data -----------------------------------------------------------------------------------

id <- fls[grep('Scallop_Search_2023', fls$name), 'id'] %>% pull(id)
Expand Down Expand Up @@ -170,18 +205,21 @@ cntdat <- cntdatother %>%
bind_rows(cntdat2020) %>%
bind_rows(cntdat2022) %>%
bind_rows(cntdat2023) %>%
bind_rows(cntdat2024) %>%
arrange(yr, id)

save(cntdat, file = 'data/cntdat.RData', compress = 'xz')

# hex data ----------------------------------------------------------------

hex <- st_read('data-raw/2022_Hex_Update.shp') %>%
hex <- st_read(here('data-raw/2024_GBSS_Hex_Update.shp')) %>%
st_transform(crs = prj) %>%
select(Bay_Segment = Bay_Segmen, hex = Site_Numbe) %>%
mutate(legacy = case_when(
hex <= 229 ~ T, # this is the highest hex number from the original file HexagonSites_Edited200910_Final.shp
T ~ F
))
mutate(yr = case_when(
hex < 301 ~ 'pre 2023',
hex %in% c(301:340) ~ 'added 2023',
hex %in% c(401:433) ~ 'added 2024'
)
)

save(hex, file = 'data/hex.RData', compress = 'xz')
8 changes: 7 additions & 1 deletion R/funcs.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
plo_fun <- function(cntdat, yr, hexsf, colpal = NULL){

if(yr < 2023)
hexsf <- hexsf[hexsf$legacy, ]
hexsf <- hexsf[hexsf$yr == 'pre 2023', ]

if(yr == 2023)
hexsf <- hexsf[hexsf$yr %in% c('pre 2023', 'added 2023'), ]

if(yr == 2024) # all, but added for posterity
hexsf <- hexsf[hexsf$yr %in% c('pre 2023', 'added 2023', 'added 2024'), ]

tomap <- cntdat %>%
filter(yr == !!yr) %>%
Expand Down
1 change: 1 addition & 0 deletions data-raw/2024_GBSS_Hex_Update.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file added data-raw/2024_GBSS_Hex_Update.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions data-raw/2024_GBSS_Hex_Update.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD_1983_2011_StatePlane_Florida_West_FIPS_0902_Ft_US",GEOGCS["GCS_NAD_1983_2011",DATUM["D_NAD_1983_2011",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",656166.6666666665],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-82.0],PARAMETER["Scale_Factor",0.9999411764705882],PARAMETER["Latitude_Of_Origin",24.33333333333333],UNIT["Foot_US",0.3048006096012192]]
Binary file added data-raw/2024_GBSS_Hex_Update.sbn
Binary file not shown.
Binary file added data-raw/2024_GBSS_Hex_Update.sbx
Binary file not shown.
Binary file added data-raw/2024_GBSS_Hex_Update.shp
Binary file not shown.
1 change: 1 addition & 0 deletions data-raw/2024_GBSS_Hex_Update.shp.xml

Large diffs are not rendered by default.

Binary file added data-raw/2024_GBSS_Hex_Update.shx
Binary file not shown.
Binary file modified data/cntdat.RData
Binary file not shown.
Binary file modified data/hex.RData
Binary file not shown.
34 changes: 34 additions & 0 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,40 @@ Citation info here: [![DOI](https://zenodo.org/badge/295835015.svg)](https://zen
<div class = "col-md-2"></div>
</div>

2024 {data-navmenu="RESULTS BY YEAR"}
=======================================================================

Column
-------------------------------------

### `r txt`

```{r, out.width = '100%'}
yr <- 2024
plo_fun(cntdat, yr, hex)
```

Column
-------------------------------------

###

```{r}
sclbox_fun(cntdat, yr)
```

###

```{r}
btsbox_fun(cntdat, yr)
```

###

```{r}
cntbox_fun(cntdat, yr)
```

2023 {data-navmenu="RESULTS BY YEAR"}
=======================================================================

Expand Down
2,828 changes: 1,763 additions & 1,065 deletions index.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions scallop-search.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

UseNativePipeOperator: No

0 comments on commit 9b3f478

Please sign in to comment.