Skip to content

Commit

Permalink
Merge branch 'eco4cast:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
addelany authored May 15, 2024
2 parents 0b18d9d + b0834c0 commit f1a444c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
24 changes: 12 additions & 12 deletions R/build_targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
#'@export
#'
build_targets <- function(table_schema,
table_description,
start_date,
end_date,
id_value,
description_string,
about_string,
about_title,
theme_title,
destination_path,
link_items,
thumbnail_link,
thumbnail_title
table_description,
start_date,
end_date,
id_value,
description_string,
about_string,
about_title,
theme_title,
destination_path,
link_items,
thumbnail_link,
thumbnail_title
){

# insitu_targets_link <- config$insitu_targets_file
Expand Down
10 changes: 8 additions & 2 deletions R/get_site_coords.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ get_site_coords <- function(site_metadata, sites){

site_df <- readr::read_csv(site_metadata, col_types = cols())

relevant_sites <- sites[which(sites %in% site_df$field_site_id)]
if ('site_id' %in% names(site_df) == FALSE){
site_df <- site_df |>
rename(site_id = field_site_id) ## rename the neon site_id column
}

site_lat_lon <- lapply(relevant_sites, function(i) c(site_df$longitude[which(site_df[,2] == i)], site_df$latitude[which(site_df[,2] == i)]))
relevant_sites <- sites[which(sites %in% site_df$site_id)]

site_lat_lon <- lapply(relevant_sites, function(i){c(site_df$longitude[which(site_df$site_id == i)],
site_df$latitude[which(site_df$site_id == i)])})

return(site_lat_lon)
}

0 comments on commit f1a444c

Please sign in to comment.