Skip to content

Commit

Permalink
feat: add location name in function return
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Dec 12, 2023
1 parent 89741b9 commit c15021a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/address_to_coords.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ address_to_coords <- function(address) {

if (length(results) == 0) {

return(data.frame("lon" = numeric(0),
"lat" = numeric(0)))
return(data.frame("lon" = numeric(0),
"lat" = numeric(0),
"name" = character(0)))

} else {

return(data.frame("lon" = as.numeric(results$"lon"),
"lat" = as.numeric(results$"lat")))
return(data.frame("lon" = as.numeric(results$"lon"),
"lat" = as.numeric(results$"lat"),
"name" = results$"display_name"))
}
}

0 comments on commit c15021a

Please sign in to comment.