Returns a color coded table with frequency of each rank. Initial, median and modal rank frequency cells are color-coded.

ranksCount_colCode(x, decim = 2, path, year = "")

Arguments

x

A dataframe containing the ranks for different simulations - such as returned by linearAggExc(). Column 1 - statistical units (countries, regions, companies etc.). Column 2 - time (year, or month, or day etc. - numeric). Rest of columns - ranks in simulations.

decim

Numeric. Specifies the number of decimals to display. Default is 2.

path

Specifies the path to the folder where the returned .xlsx file ("Color coded ranks frequency.xlsx") to be saved.

year

Specifies the period in case the user wants the returned file to be saved as "Color coded ranks frequency year.xlsx".

Value

A table with: Column 1- statistical units; column 2- time; column 3- frequency of taking rank 1; and so on. For each statistical unit: The cell that shows the frequency of the initial rank is bordered in red. The frequency of the median rank is bolded. The frequency of the modal rank is written in blue. If path is specified, it also writes a .xlsx file in the path folder. The function was created haing in mind the .xlsx export.

Examples

ranks2001[1:5,1:5]
#>   Statistical.unit Time S0 S1 S2
#> 1          Belgium 2001 14 15 14
#> 2         Bulgaria 2001  8  7  8
#> 3   Czech Republic 2001  5  4  6
#> 4          Denmark 2001 25 25 25
#> 5          Germany 2001 13 11 12
#ranksCount_colCode(ranks2001, decim=4, path="E:/Sample folder", year="2001")
a=ranksCount_colCode(ranks2001,decim=0)
#> Loading required package: basictabler
#> Loading required package: openxlsx
a