зеркало из https://github.com/Azure/AzureDSVM.git
Avoided join message and reordered columns
This commit is contained in:
Родитель
edca374583
Коммит
79c5be6372
|
@ -340,11 +340,17 @@ expenseCalculator <- function(context,
|
||||||
filter(df_rates, MeterId %in% meter_list) %>%
|
filter(df_rates, MeterId %in% meter_list) %>%
|
||||||
rename(meterId=MeterId)
|
rename(meterId=MeterId)
|
||||||
|
|
||||||
|
# invisible(capture.output(df_cost <- left_join(df_used_data, df_used_rates)))
|
||||||
|
|
||||||
df_cost <-
|
df_cost <-
|
||||||
left_join(df_used_data, df_used_rates) %>%
|
left_join(df_used_data, df_used_rates, by="meterId") %>%
|
||||||
mutate(Cost=totalQuantity * MeterRate) %>%
|
mutate(Cost=totalQuantity * MeterRate) %>%
|
||||||
select(-IncludedQuantity, -EffectiveDate, -MeterStatus, -usageStartDate, -usageEndDate, -meterId, -MeterRegion) %>%
|
select(-IncludedQuantity, -EffectiveDate, -MeterStatus, -usageStartDate, -usageEndDate, -meterId, -MeterRegion) %>%
|
||||||
na.omit()
|
na.omit()
|
||||||
|
|
||||||
|
# reorder columns.
|
||||||
|
|
||||||
|
df_cost <- df_cost[, c(3, 2, 4, 1, 5, 6, 7)]
|
||||||
|
|
||||||
df_cost
|
df_cost
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче