Skip to content

Commit

Permalink
organizing code
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Oct 11, 2024
1 parent f036670 commit b594fde
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions R/read_aircrafts.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ read_aircrafts <- function(date = 202001,
# check if download failed
if (is.null(dt)) { return(invisible(NULL)) }

# convert columns to numeric
convert_to_numeric(dt)

# clean names
nnn <- names(dt)
data.table::setnames(
Expand All @@ -64,5 +61,8 @@ read_aircrafts <- function(date = 202001,
new = janitor::make_clean_names(nnn)
)

# convert columns to numeric
convert_to_numeric(dt)

return(dt)
}
6 changes: 3 additions & 3 deletions R/read_airport_movements.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ read_airport_movements <- function(date = 202001,
# check if download failed
if (is.null(dt)) { return(invisible(NULL)) }

# convert columns to numeric
convert_to_numeric(dt)

# clean names
nnn <- names(dt)
data.table::setnames(
Expand All @@ -67,5 +64,8 @@ read_airport_movements <- function(date = 202001,
new = janitor::make_clean_names(nnn)
)

# convert columns to numeric
convert_to_numeric(dt)

return(dt)
}
6 changes: 3 additions & 3 deletions R/read_flights.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ read_flights <- function(date = 202001,
# row bind data tables
dt <- data.table::rbindlist(dt_list, fill = TRUE)

# convert columns to numeric
convert_to_numeric(dt)

# clean names
nnn <- names(dt)
data.table::setnames(
Expand All @@ -83,6 +80,9 @@ read_flights <- function(date = 202001,
new = janitor::make_clean_names(nnn)
)

# convert columns to numeric
convert_to_numeric(dt)

return(dt)
}

0 comments on commit b594fde

Please sign in to comment.