Skip to content

Commit

Permalink
fixed format in stopifnot
Browse files Browse the repository at this point in the history
  • Loading branch information
GohtaAihara committed Jan 22, 2024
1 parent 0ce1cba commit 65956b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ rasterizeMatrix <- function(data, pos, bbox, resolution = 100, fun = "mean", n_t
BiocParallel::bpstart(BPPARAM)

## check to see if bbox input is of class numeric or bbox, if numeric, convert to st_bbox
stopifnot(class(bbox) %in% c('numeric', 'bbox'), "bbox must be of class 'numeric' or 'bbox' (as generated by sf::st_bbox)")
stopifnot("bbox must be of class 'numeric' or 'bbox' (as generated by sf::st_bbox)" = class(bbox) %in% c('numeric', 'bbox'))
if (class(bbox)=='numeric') {
stopifnot(length(bbox)==4, 'Bounding box for rasterization must be defined by a numeric vector of length four, with xmin, ymin, xmax and ymax values or object of class bbox (as generated by sf::st_bbox)')
stopifnot("Bounding box for rasterization must be defined by a numeric vector of length four, with xmin, ymin, xmax and ymax values or object of class bbox (as generated by sf::st_bbox)" = length(bbox)==4)
bbox <- sf::st_bbox(c(xmin = bbox[1], ymin = bbox[2], xmax = bbox[3], ymax = bbox[4]))
}
## create grid for rasterization
Expand Down

0 comments on commit 65956b2

Please sign in to comment.