From 6b6c927ff3e810fc338640b87ff4f48e0f50bb56 Mon Sep 17 00:00:00 2001 From: addelany Date: Tue, 6 Feb 2024 16:13:28 -0600 Subject: [PATCH] make bbox code more flexible --- R/get_bbox.R | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/R/get_bbox.R b/R/get_bbox.R index 1555e24..805a398 100644 --- a/R/get_bbox.R +++ b/R/get_bbox.R @@ -12,13 +12,17 @@ get_bbox <-function(site_metadata, sites){ if (!is.null(sites)){ - site_lat <- site_df |> - filter(field_site_id %in% (sites)) |> - select(latitude) + # site_lat <- site_df |> + # filter(field_site_id %in% (sites)) |> + # select(latitude) + # + # site_lon <- site_df |> + # filter(field_site_id %in% (sites)) |> + # select(longitude) + + site_lat <- site_df[which(site_df[,2] == sites), 'latitude'] + site_lon <- site_df[which(site_df[,2] == sites), 'longitude'] - site_lon <- site_df |> - filter(field_site_id %in% (sites)) |> - select(longitude) #site_lat <- sapply(sites,function(i) site_df$latitude[which(site_df[,2] == i)]) #site_lon <- sapply(sites,function(i) site_df$longitude[which(site_df[,2] == i)])