Skip to content

Commit 0327388

Browse files
committed
Merge branch 'master' of https://github.com/tbep-tech/tbeptools
2 parents 4e853d3 + e8b515b commit 0327388

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

R/show_transect.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ show_transect <- function(transect, site, species = c('Halodule', 'Syringodium',
8080
T ~ Savspecies
8181
)
8282
) %>%
83-
tidyr::spread(Savspecies, aveval, fill = 0) %>%
83+
tidyr::pivot_wider(names_from = 'Savspecies', values_from = 'aveval', values_fill = 0, values_fn = max) %>%
8484
dplyr::select(Date, Site, dplyr::matches(paste0('^', species))) %>%
8585
tidyr::pivot_longer(dplyr::matches(paste0('^', species)), values_to = 'val') %>%
8686
dplyr::mutate(
@@ -89,7 +89,7 @@ show_transect <- function(transect, site, species = c('Halodule', 'Syringodium',
8989

9090
# stop if no data for the species, transect
9191
if(inherits(dat, 'try-error'))
92-
stop(paste('No data for', species, 'at transect', site))
92+
stop(paste('No data for', paste(species, collapse = ', '), 'at transect', site))
9393

9494
dat <- dat %>%
9595
dplyr::mutate(

0 commit comments

Comments
 (0)