Skip to content

Commit

Permalink
Make read_map fail gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Nov 3, 2023
1 parent 400d98f commit e4f643a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/read_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ read_map <- function(city = "S\u00E3o Paulo",
# parameter and saving the function return in "temporary_filename"
temporary_filename <- download_piggyback(filename_to_download, force_download)

# check if download worked
if(is.null(temporary_filename)) { return(NULL) }

Check warning on line 86 in R/read_map.R

View workflow job for this annotation

GitHub Actions / lint

file=R/read_map.R,line=86,col=5,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.

Check warning on line 86 in R/read_map.R

View workflow job for this annotation

GitHub Actions / lint

file=R/read_map.R,line=86,col=35,[brace_linter] Opening curly braces should never go on their own line and should always be followed by a new line.

Check warning on line 86 in R/read_map.R

View workflow job for this annotation

GitHub Actions / lint

file=R/read_map.R,line=86,col=50,[brace_linter] Closing curly-braces should always be on their own line, unless they are followed by an else.

Check warning on line 86 in R/read_map.R

View workflow job for this annotation

GitHub Actions / lint-project

file=R/read_map.R,line=86,col=5,[spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.

Check warning on line 86 in R/read_map.R

View workflow job for this annotation

GitHub Actions / lint-project

file=R/read_map.R,line=86,col=35,[brace_linter] Opening curly braces should never go on their own line and should always be followed by a new line.

Check warning on line 86 in R/read_map.R

View workflow job for this annotation

GitHub Actions / lint-project

file=R/read_map.R,line=86,col=50,[brace_linter] Closing curly-braces should always be on their own line, unless they are followed by an else.

# Reading shape files
od_map <- sf::read_sf(temporary_filename)

Expand Down

0 comments on commit e4f643a

Please sign in to comment.