Skip to content

Commit

Permalink
Remove redundant importFrom statements
Browse files Browse the repository at this point in the history
Packages listed under DEPENDS in the DESCRIPTION file are imported with the import statement. There is no need to import individual functions after that. This commit is in line with the latest practices recommended by RSE.
  • Loading branch information
johanneskoch94 committed May 11, 2024
1 parent 6f0fe53 commit 59d997a
Show file tree
Hide file tree
Showing 117 changed files with 3 additions and 201 deletions.
57 changes: 0 additions & 57 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -166,63 +166,6 @@ importFrom(ggplot2,scale_linetype_manual)
importFrom(ggplot2,scale_shape_manual)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_minimal)
importFrom(madrat,calcOutput)
importFrom(madrat,getConfig)
importFrom(madrat,getISOlist)
importFrom(madrat,madratAttach)
importFrom(madrat,readSource)
importFrom(madrat,toolAggregate)
importFrom(madrat,toolCountry2isocode)
importFrom(madrat,toolCountryFill)
importFrom(madrat,toolFillWithRegionAvg)
importFrom(madrat,toolFillYears)
importFrom(madrat,toolGetMapping)
importFrom(madrat,toolISOhistorical)
importFrom(madrat,toolNAreplace)
importFrom(madrat,toolSubtypeSelect)
importFrom(madrat,vcat)
importFrom(magclass,"getItems<-")
importFrom(magclass,"getNames<-")
importFrom(magclass,"getRegions<-")
importFrom(magclass,"getSets<-")
importFrom(magclass,"getYears<-")
importFrom(magclass,"mselect<-")
importFrom(magclass,add_columns)
importFrom(magclass,add_dimension)
importFrom(magclass,as.data.frame)
importFrom(magclass,as.magpie)
importFrom(magclass,clean_magpie)
importFrom(magclass,collapseDim)
importFrom(magclass,collapseNames)
importFrom(magclass,complete_magpie)
importFrom(magclass,dimReduce)
importFrom(magclass,dimSums)
importFrom(magclass,getCells)
importFrom(magclass,getItems)
importFrom(magclass,getNames)
importFrom(magclass,getRegions)
importFrom(magclass,getSets)
importFrom(magclass,getYears)
importFrom(magclass,is.magpie)
importFrom(magclass,magpiesort)
importFrom(magclass,magpply)
importFrom(magclass,mbind)
importFrom(magclass,mselect)
importFrom(magclass,ndim)
importFrom(magclass,new.magpie)
importFrom(magclass,nregions)
importFrom(magclass,nyears)
importFrom(magclass,read.magpie)
importFrom(magclass,read.report)
importFrom(magclass,replace_non_finite)
importFrom(magclass,setCells)
importFrom(magclass,setItems)
importFrom(magclass,setNames)
importFrom(magclass,setYears)
importFrom(magclass,time_interpolate)
importFrom(magclass,where)
importFrom(magclass,write.magpie)
importFrom(magclass,write.report)
importFrom(magrittr,"%<>%")
importFrom(magrittr,"%>%")
importFrom(plyr,round_any)
Expand Down
1 change: 0 additions & 1 deletion R/EDGE-Industry.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#' geom_line geom_path geom_point ggplot ggsave guide_legend labs
#' scale_colour_manual scale_fill_discrete scale_fill_manual
#' scale_linetype_manual scale_shape_manual theme theme_minimal
#' @importFrom madrat calcOutput readSource toolGetMapping
#' @importFrom quitte calc_mode character.data.frame df_populate_range duplicate
#' duplicate_ list_to_data_frame madrat_mule magclass_to_tibble order.levels
#' seq_range sum_total_
Expand Down
2 changes: 0 additions & 2 deletions R/UNIDO.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
#' @importFrom assertr assert not_na
#' @importFrom dplyr anti_join bind_rows filter group_by inner_join left_join
#' mutate select summarise
#' @importFrom madrat readSource toolCountryFill
#' @importFrom magclass as.magpie dimSums mbind setNames
#' @importFrom magrittr %>%
#' @importFrom quitte list_to_data_frame madrat_mule
#' @importFrom readr read_csv
Expand Down
2 changes: 0 additions & 2 deletions R/calcAGEB.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#' @param subtype data subtype. Either "balances" ("Auswertungstabellen zur Energiebilanz Deutschland") or
#' "electricity" ("Bruttostromerzeugung in Deutschland nach Energieträgern")
#' @importFrom dplyr select mutate left_join
#' @importFrom madrat toolGetMapping toolCountryFill
#' @importFrom magclass as.magpie mselect
#' @importFrom rlang sym
#' @importFrom stats aggregate
#' @export
Expand Down
2 changes: 0 additions & 2 deletions R/calcBP.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#'
#' @author Falk Benke
#' @importFrom dplyr select mutate left_join
#' @importFrom madrat toolGetMapping toolCountryFill
#' @importFrom magclass as.magpie mselect
#' @importFrom readxl read_excel
#' @importFrom rlang sym
#' @importFrom stats aggregate
Expand Down
2 changes: 0 additions & 2 deletions R/calcBiomassPrices.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#' read biomass supply curves from Magpie emulator
#' @return Magpie object with two parameters determining linear biomass supply curve
#' @importFrom magclass dimReduce
#' @importFrom madrat readSource
#' @import mrcommons

calcBiomassPrices <- function(){
Expand Down
1 change: 0 additions & 1 deletion R/calcCapacityNuclear.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

#' @importFrom magclass setYears

calcCapacityNuclear <- function() {
### overall philosophy:
Expand Down
1 change: 0 additions & 1 deletion R/calcCapacityOffset.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @importFrom magclass getYears<-

calcCapacityOffset <- function() {
x <- readSource("REMIND_11Regi", subtype="deltacapoffset")
Expand Down
1 change: 0 additions & 1 deletion R/calcCement.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#' @seealso [calcOutput]
#'
#' @importFrom dplyr anti_join arrange bind_rows filter group_by select ungroup
#' @importFrom magclass as.magpie
#' @importFrom magrittr %>%
#' @importFrom rlang .data syms !!!

Expand Down
2 changes: 0 additions & 2 deletions R/calcCementShare.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#' @seealso [`calcOutput()`]
#'
#' @importFrom dplyr bind_rows left_join select filter mutate pull
#' @importFrom madrat toolGetMapping calcOutput
#' @importFrom magclass as.magpie dimSums
#' @importFrom magrittr %>%
#' @importFrom rlang sym
#' @importFrom tibble tribble as_tibble
Expand Down
1 change: 0 additions & 1 deletion R/calcClinker_to_cement_ratio.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#'
#' @seealso [`calcOutput()`], [`readADVANCE_WP2()`], [`convertADVANCE_WP2()`]
#'
#' @importFrom madrat readSource calcOutput
#'
#' @export
calcClinker_to_cement_ratio <- function() {
Expand Down
1 change: 0 additions & 1 deletion R/calcCoolingSharesAll.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#' a <- calcOutput("CoolingSharesAll")
#'
#' }
#' @importFrom magclass mbind dimSums
#'
calcCoolingSharesAll <- function() {

Expand Down
2 changes: 0 additions & 2 deletions R/calcCoolingSharesBase.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
#' \dontrun{
#' a <- calcOutput("CoolingSharesBase")
#' }
#' @importFrom magclass getNames<-
#' @importFrom readxl read_excel
#' @importFrom madrat toolGetMapping



Expand Down
1 change: 0 additions & 1 deletion R/calcCoolingSharesFuture.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#' a <- calcOutput("CoolingSharesFuture")
#'
#' }
#' @importFrom magclass getNames<- dimSums mbind
#' @importFrom readxl read_excel
#'
calcCoolingSharesFuture <- function() {
Expand Down
1 change: 0 additions & 1 deletion R/calcDiffInvestCosts.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#' @param subtype Investment Costs, I&M Costs, and Efficiency
#' @return Magpie object with aggregated but diffrentiated investment costs for some technologies.
#' @author Aman Malik
#' @importFrom magclass new.magpie
#' @importFrom dplyr filter %>%

calcDiffInvestCosts <- function(subtype){
Expand Down
2 changes: 0 additions & 2 deletions R/calcEEAGHGProjections.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#' @author Falk Benke
#'
#' @importFrom dplyr select mutate left_join
#' @importFrom madrat toolGetMapping toolCountryFill
#' @importFrom magclass as.magpie
#' @importFrom rlang sym
#' @importFrom quitte calc_addVariable
#' @export
Expand Down
1 change: 0 additions & 1 deletion R/calcEconometricEmiParameter.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#' calcOutput("calcEconometricEmiParameter")
#' }
#' @importFrom utils read.csv
#' @importFrom magclass getNames<- getYears<-


calcEconometricEmiParameter <- function() {
Expand Down
2 changes: 0 additions & 2 deletions R/calcEmber.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#'
#' @author Pascal Weigmann
#'
#' @importFrom madrat toolAggregate toolGetMapping
#' @importFrom magclass collapseDim
#'
#' @export

Expand Down
1 change: 0 additions & 1 deletion R/calcEmiFossilFuelExtr.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @importFrom magclass getNames<-

calcEmiFossilFuelExtr <- function() {

Expand Down
1 change: 0 additions & 1 deletion R/calcEmiLULUCFCountryAcc.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#' @return Magpie object with historical LULUCF emissions
#' @param subtype Valid subtypes are 'UNFCCC'
#' @author Felix Schreyer
#' @importFrom magclass dimReduce

calcEmiLULUCFCountryAcc <- function(subtype) {
if (subtype == "UNFCCC") {
Expand Down
1 change: 0 additions & 1 deletion R/calcEmiMac1990.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#' \dontrun{
#' calcOutput("calcEmiMac1990")
#' }
#' @importFrom magclass getNames<- getYears<-
calcEmiMac1990 <- function() {

# emissions for the calculation of econometric paramter p1
Expand Down
1 change: 0 additions & 1 deletion R/calcEmiPollutantExo.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#' }
#'
#'
#' @importFrom magclass getSets getYears time_interpolate complete_magpie


calcEmiPollutantExo <- function(subtype, aviationshippingsource="RCP"){
Expand Down
1 change: 0 additions & 1 deletion R/calcEmiTarget.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#' @author Aman Malik, Christoph Bertram, Oliver Richters
#' @param sources currently only UNFCCC_NDC
#' @param subtype "Ghgshare2005", "Ghgfactor", "Ghghistshare"
#' @importFrom magclass getNames

calcEmiTarget <- function(sources, subtype) {

Expand Down
2 changes: 0 additions & 2 deletions R/calcEmissionFactors.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#' @importFrom dplyr group_by_ summarise_ ungroup mutate_ rename_ filter_ select_
#' @importFrom magclass as.magpie getCells getSets<- getNames<- getSets getRegions<-
#' mselect<- setNames write.magpie setCells mselect
#' @importFrom tidyr gather_
#' @importFrom utils read.csv read.csv2
#' @importFrom quitte as.quitte
Expand Down
2 changes: 0 additions & 2 deletions R/calcEmissionFactorsFeedstocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#' @seealso [`calcOutput()`]
#'
#' @importFrom dplyr filter pull select
#' @importFrom madrat getISOlist toolFillYears
#' @importFrom magclass new.magpie getItems
#' @importFrom rlang .data
#' @importFrom tibble as_tibble

Expand Down
1 change: 0 additions & 1 deletion R/calcEmissions.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#'
#' @author Steve Smith, Pascal Weigmann
#'
#' @importFrom magclass ndim setNames getNames<-
#' @importFrom utils read.csv2
#' @importFrom dplyr filter_ mutate_

Expand Down
2 changes: 0 additions & 2 deletions R/calcEuropeanEnergyDatasheets.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#' @author Falk Benke
#'
#' @importFrom dplyr select mutate left_join
#' @importFrom madrat toolGetMapping
#' @importFrom magclass as.magpie
#' @importFrom rlang sym
#' @importFrom stats aggregate na.exclude

Expand Down
1 change: 0 additions & 1 deletion R/calcExogDemScen.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#'
#' @return A [`magpie`][magclass::magclass] object.
#' @author Felix Schreyer
#' @importFrom magclass mselect collapseNames getNames getRegions



Expand Down
1 change: 0 additions & 1 deletion R/calcFGas.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#' \dontrun{
#' x <- calcOutput("FGas")
#' }
#' @importFrom magclass getNames<- getSets clean_magpie

calcFGas <- function(subtype = "interpolate2025") {
# read in IMAGE data
Expand Down
2 changes: 0 additions & 2 deletions R/calcFeDemandIndustry.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#' @importFrom dplyr anti_join arrange as_tibble between bind_rows case_when
#' distinct filter first full_join group_by inner_join lag last left_join
#' matches mutate n rename right_join select semi_join summarise ungroup
#' @importFrom magclass mselect getItems getItems<- time_interpolate
#' @importFrom madrat toolAggregate
#' @importFrom magrittr %>% %<>%
#' @importFrom quitte as.quitte cartesian character.data.frame
#' interpolate_missing_periods interpolate_missing_periods_ madrat_mule
Expand Down
2 changes: 0 additions & 2 deletions R/calcFloorspace.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#' @param onlyTotal boolean, only give total instead of sub-sectoral floor space
#' @return MAgPIE object with buildings floor space
#'
#' @importFrom madrat readSource
#' @importFrom magclass collapseNames
#' @export
#'
calcFloorspace <- function(onlyTotal = FALSE) {
Expand Down
1 change: 0 additions & 1 deletion R/calcGAINS.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#' @param subtype decides whether emissions or emission factors are returned
#' @param sectoral_resolution aggreaged or extenden (uses different GAINS input data)
#' @importFrom dplyr group_by_ summarise_ ungroup mutate_ rename_ filter_ select_
#' @importFrom magclass as.magpie getCells getSets<- getNames<- getSets getRegions<- mselect<- setNames write.magpie
#' @importFrom tidyr gather_
#' @importFrom utils read.csv read.csv2
#' @importFrom quitte as.quitte
Expand Down
1 change: 0 additions & 1 deletion R/calcGlobalEnergyMonitor.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#' @return A [`magpie`][magclass::magclass] object.
#'
#' @author Falk Benke
#' @importFrom magclass add_dimension
#' @export

calcGlobalEnergyMonitor <- function() {
Expand Down
2 changes: 0 additions & 2 deletions R/calcHRE.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#' @author Pascal Weigmann
#'
#' @importFrom dplyr select
#' @importFrom madrat toolGetMapping
#' @importFrom magclass as.magpie
#' @export

calcHRE <- function() {
Expand Down
1 change: 0 additions & 1 deletion R/calcHistorical.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#' Gather reference data from various sources.
#' @importFrom magclass setNames getNames getSets add_columns
#' @importFrom dplyr filter group_by mutate select ungroup
#' @importFrom rlang syms
#' @importFrom tidyr complete nesting
Expand Down
2 changes: 0 additions & 2 deletions R/calcIEA_ETP.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#' @author Falk Benke
#'
#' @importFrom dplyr select mutate left_join
#' @importFrom madrat toolGetMapping
#' @importFrom magclass as.magpie
#' @importFrom rlang sym
#' @importFrom stats aggregate na.pass
#' @export
Expand Down
2 changes: 0 additions & 2 deletions R/calcIEA_EVOutlook.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#'
#' @author Falk Benke
#' @importFrom dplyr select mutate left_join
#' @importFrom madrat toolGetMapping toolCountryFill
#' @importFrom magclass as.magpie
#' @importFrom readxl read_excel
#' @importFrom rlang sym
#' @importFrom stats aggregate
Expand Down
2 changes: 0 additions & 2 deletions R/calcIEA_WorldEnergyOutlook.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#' 'latest' (free, restricted, up-to-date dataset)
#' @author Falk Benke
#' @importFrom dplyr select mutate left_join case_when
#' @importFrom madrat toolGetMapping
#' @importFrom magclass as.magpie
#' @importFrom stats aggregate
#' @export

Expand Down
1 change: 0 additions & 1 deletion R/calcINNOPATHS.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#' @importFrom dplyr left_join select filter mutate %>%
#' @importFrom madrat toolGetMapping
#'
calcINNOPATHS <- function() {

Expand Down
2 changes: 0 additions & 2 deletions R/calcIndustry_EEK.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#' @importFrom assertr assert
#' @importFrom dplyr %>% arrange bind_rows filter group_by lag lead mutate n
#' row_number select
#' @importFrom madrat calcOutput readSource getISOlist
#' @importFrom magclass mbind
#' @importFrom quitte madrat_mule
#' @importFrom purrr map reduce
#' @importFrom rlang .data .env sym syms
Expand Down
2 changes: 0 additions & 2 deletions R/calcJRC_IDEES.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#'
#'
#' @importFrom dplyr select mutate left_join
#' @importFrom madrat toolGetMapping toolCountryFill
#' @importFrom magclass as.magpie mbind mselect
#' @importFrom rlang sym
#' @importFrom stats aggregate

Expand Down
1 change: 0 additions & 1 deletion R/calcMACCbaseN2O.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @importFrom magclass getNames

calcMACCbaseN2O <- function() {

Expand Down
Loading

0 comments on commit 59d997a

Please sign in to comment.