Skip to content

Commit

Permalink
use snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
hansvancalster committed Feb 13, 2024
1 parent ad02c87 commit 1b5740e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/r/check_presence.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ check_presence <- function(
require(purrr)
if (!is.null(input) && file.exists(input)) {
# Read scientific names from the input file
scientificNames <- readLines(input)
scientific_names <- readLines(input)
} else if (is.character(input)) {
scientificNames <- input
scientific_names <- input
} else {
stop("Input must be either a character vector or a valid file path.")
}

# Remove any empty lines
scientificNames <- scientificNames[scientificNames != ""]
scientific_names <- scientific_names[scientific_names != ""]

# Initialize vector to store presence results
presence <- logical(length(scientificNames))
presence <- logical(length(scientific_names))

# Loop over each country
for (country in countries) {
Expand All @@ -53,7 +53,7 @@ check_presence <- function(
}

# Map over scientific names and check occurrence data for the current country

Check warning on line 55 in source/r/check_presence.R

View workflow job for this annotation

GitHub Actions / check project with checklist

file=source/r/check_presence.R,line=55,col=81,[line_length_linter] Lines should not be more than 80 characters.
country_presence <- purrr::map_lgl(scientificNames, check_occurrence)
country_presence <- purrr::map_lgl(scientific_names, check_occurrence)

# Update presence vector with results for the current country
presence <- presence | country_presence
Expand All @@ -62,7 +62,7 @@ check_presence <- function(
# Create tibble with results
result_table <- tibble::tibble(
present = presence,
scientificName = scientificNames
scientific_name = scientific_names
)

return(result_table)
Expand Down

0 comments on commit 1b5740e

Please sign in to comment.