Example 1. How to calculate specific energy poverty index for a
selected year
- Define the year (eg. 2019) and the energy poverty index (eg. LIHC)
in 
calc_ep
 
file <- calc_ep(year = 2019,        # Select the year
                index = "LIHC")     # Select the index or a vector: c("2M", "LIHC")
 
- Define the directory to save the outputs
 
setwd(path)   # Indicate the path to save the outputs
 
- Save the output dataframe in excel
 
write.xlsx(file,                         # File name or full file path
           "File_name.xlsx",             # Indicate the file name of the excel to be saved
           sheetName = "sheet_name",     # Indicate the sheet name
           ...)
 
 
Example 2. How to calculate all energy poverty indices for a time
series
- Define the time series
 
time_series <- seq(2006,2021,1)
 
- Calculate energy poverty indices for the defined time series
 
file <- calc_ep(year = time_series,      # Select the vector with the selected years
                index = "all")           # Select all indices (by default)
 
- Define the directory to save the outputs
 
setwd(path)   # Indicate the path to save the outputs
 
- Save the output dataframe in excel
 
write.xlsx(file,                         # File name or full file path
           "File_name.xlsx",             # Indicate the file name of the excel to be saved
           sheetName = "sheet_name",     # Indicate the sheet name
           ...)