Skip to content

Commit

Permalink
Fix dplyr::select() error when using .data
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdmeulen committed Nov 1, 2022
1 parent b961407 commit cc1e2fa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
32 changes: 16 additions & 16 deletions R/load_ots.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ load_ots <- function(month = NULL,
dplyr::left_join(supp_lookup, by = "SuppressionIndex") %>%
# Put data in an order that makes more sense:
dplyr::select(
.data$MonthId,
.data$FlowTypeId,
.data$FlowTypeDescription,
.data$SuppressionIndex,
.data$SuppressionDesc,
dplyr::contains("MonthId"),
dplyr::contains("FlowTypeId"),
dplyr::contains("FlowTypeDescription"),
dplyr::contains("SuppressionIndex"),
dplyr::contains("SuppressionDesc"),
dplyr::contains("Hs2"),
dplyr::contains("Hs4"),
dplyr::contains("Hs6"),
Expand All @@ -305,17 +305,17 @@ load_ots <- function(month = NULL,
dplyr::contains("Area2"),
dplyr::contains("Area3"),
dplyr::contains("Area5a"),
.data$CountryId,
.data$CountryCodeNumeric,
.data$CountryCodeAlpha,
.data$CountryName,
.data$PortId,
.data$PortCodeNumeric,
.data$PortCodeAlpha,
.data$PortName,
.data$Value,
.data$NetMass,
.data$SuppUnit
dplyr::contains("CountryId"),
dplyr::contains("CountryCodeNumeric"),
dplyr::contains("CountryCodeAlpha"),
dplyr::contains("CountryName"),
dplyr::contains("PortId"),
dplyr::contains("PortCodeNumeric"),
dplyr::contains("PortCodeAlpha"),
dplyr::contains("PortName"),
dplyr::contains("Value"),
dplyr::contains("NetMass"),
dplyr::contains("SuppUnit")
)

ots_data <- if(output == "df") {
Expand Down
18 changes: 9 additions & 9 deletions R/load_rts.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,22 +225,22 @@ load_rts <- function(month = NULL,
dplyr::left_join(ukcountry_lookup, by = "GovRegionId") %>%
# Put data in an order that makes more sense:
dplyr::select(
.data$MonthId,
.data$FlowTypeId,
.data$FlowTypeDescription,
dplyr::contains("MonthId"),
dplyr::contains("FlowTypeId"),
dplyr::contains("FlowTypeDescription"),
dplyr::contains("Sitc1"),
dplyr::contains("Sitc2"),
dplyr::contains("GovRegion"),
dplyr::contains("Area1"),
dplyr::contains("Area2"),
dplyr::contains("Area3"),
dplyr::contains("Area5a"),
.data$CountryId,
.data$CountryCodeNumeric,
.data$CountryCodeAlpha,
.data$CountryName,
.data$Value,
.data$NetMass
dplyr::contains("CountryId"),
dplyr::contains("CountryCodeNumeric"),
dplyr::contains("CountryCodeAlpha"),
dplyr::contains("CountryName"),
dplyr::contains("Value"),
dplyr::contains("NetMass")
)

rts_data <- if(output == "df") {
Expand Down

0 comments on commit cc1e2fa

Please sign in to comment.