Skip to content

Commit

Permalink
merge commit
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:frbcesab/forcis
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information
MatGreco90 committed Oct 31, 2023
2 parents 94f21f3 + 5f230fc commit 5d7fc42
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 12 deletions.
4 changes: 2 additions & 2 deletions R/database.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#'
#' @noRd

forcis_db_version <- function() "v04_26072023"
forcis_db_version <- function() "v05_14092023"



Expand All @@ -18,7 +18,7 @@ forcis_db_version <- function() "v04_26072023"
#'
#' @noRd

forcis_db_url <- function() "https://zenodo.org/record/8186736/files/"
forcis_db_url <- function() "https://zenodo.org/record/8345072/files/"



Expand Down
90 changes: 80 additions & 10 deletions R/gets.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,23 @@ get_plankton_nets_data <- function(path = ".", version = forcis_db_version(),


## Read data ----

data <- vroom::vroom(file.path(path, plankton_net_filename()), delim = ";")


## Check for data_type column ----

pos <- which("data_type" %in% colnames(data))

if (length(pos) > 0) {

data$"data_type" <- "Net"

data <- vroom::vroom(file.path(path, plankton_net_filename()))
data <- data.frame("data_type" = "Net", data)
} else {

data <- data.frame("data_type" = "Net", data)
}


taxa_columns <- get_species_names(data)

Expand Down Expand Up @@ -157,9 +171,23 @@ get_pump_data <- function(path = ".", version = forcis_db_version(),


## Read data ----

data <- vroom::vroom(file.path(path, pump_filename()), delim = ";")


## Check for data_type column ----

pos <- which("data_type" %in% colnames(data))

if (length(pos) > 0) {

data$"data_type" <- "Pump"

} else {

data <- data.frame("data_type" = "Pump", data)
}

data <- vroom::vroom(file.path(path, pump_filename()))
data <- data.frame("data_type" = "Pump", data)

taxa_columns <- get_species_names(data)

Expand Down Expand Up @@ -194,8 +222,22 @@ get_cpr_north_data <- function(path = ".", version = forcis_db_version(),

## Read data ----

data <- vroom::vroom(file.path(path, cpr_north_filename()))
data <- data.frame("data_type" = "CPR North", data)
data <- vroom::vroom(file.path(path, cpr_north_filename()), delim = ";")


## Check for data_type column ----

pos <- which("data_type" %in% colnames(data))

if (length(pos) > 0) {

data$"data_type" <- "CPR North"

} else {

data <- data.frame("data_type" = "CPR North", data)
}


data |>
dplyr::mutate(dplyr::across(.data$count_bin_min:.data$count_bin_max,
Expand Down Expand Up @@ -229,8 +271,22 @@ get_cpr_south_data <- function(path = ".", version = forcis_db_version(),

## Read data ----

data <- vroom::vroom(file.path(path, cpr_south_filename()))
data <- data.frame("data_type" = "CPR South", data)
data <- vroom::vroom(file.path(path, cpr_south_filename()), delim = ";")


## Check for data_type column ----

pos <- which("data_type" %in% colnames(data))

if (length(pos) > 0) {

data$"data_type" <- "CPR South"

} else {

data <- data.frame("data_type" = "CPR South", data)
}


taxa_columns <- get_species_names(data)

Expand Down Expand Up @@ -264,9 +320,23 @@ get_sediment_trap_data <- function(path = ".", version = forcis_db_version(),


## Read data ----

data <- vroom::vroom(file.path(path, sediment_trap_filename()), delim = ";")


## Check for data_type column ----

pos <- which("data_type" %in% colnames(data))

data <- vroom::vroom(file.path(path, sediment_trap_filename()))
data <- data.frame("data_type" = "Sediment trap", data)
if (length(pos) > 0) {

data$"data_type" <- "Sediment trap"

} else {

data <- data.frame("data_type" = "Sediment trap", data)
}


taxa_columns <- get_species_names(data)

Expand Down

0 comments on commit 5d7fc42

Please sign in to comment.