Skip to content

Commit

Permalink
reverse order of cell_size and res_size
Browse files Browse the repository at this point in the history
  • Loading branch information
shawndove committed Nov 20, 2024
1 parent 05388cf commit 42ef290
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/check_cell_size.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ check_cell_size <- function(cell_size, cell_size_units, resolution, level) {

res_size <- as.numeric(stringr::str_extract(resolution, "[0-9]*(?=km)"))

if (res_size %% cell_size != 0) {
if (cell_size %% res_size != 0) {

stop("cell_size must be a whole number multiple of the resolution.
For example, if resolution is 1 km, cell_size can be 1, 2, 3,.. 10,.. 100, etc.")
Expand All @@ -35,7 +35,7 @@ check_cell_size <- function(cell_size, cell_size_units, resolution, level) {

res_size <- as.numeric(stringr::str_extract(resolution, "[0-9,.]*(?=degrees)"))

if (res_size %% cell_size != 0) {
if (cell_size %% res_size != 0) {

stop("cell_size must be a whole number multiple of the resolution.
For example, if resolution is 0.25 degrees, cell_size can be 0.25, 0.5, 0.75, 1, etc.")
Expand Down

0 comments on commit 42ef290

Please sign in to comment.