Shortening column names of meteorological parameters to improve the readability of downloaded dataset and removing duplicated column names

meteo_shortening(data, col_names = "short", remove_duplicates = TRUE)

Arguments

data

downloaded dataset with original column names

col_names

three types of column names possible: "short" - default, values with shorten names, "full" - full English description, "polish" - original names in the dataset

remove_duplicates

whether to remove duplicated column names (default TRUE - i.e., columns with duplicated names are deleted)

Examples

monthly <- meteo_monthly(rank = "climate", year = 1969) colnames(monthly)
#> [1] "rank" "id" "station" "yy" #> [5] "mm" "tmax_abs" "tmax_mean" "tmin_abs" #> [9] "tmin_mean" "t2m_mean_mon" "t5cm_min" "rr_monthly" #> [13] "rr_max_daily" "first_day_max_rr" "last_day_max_rr" "snowcover_max" #> [17] "snowcover_days" "rain_days" "snow_days" "rh_mean_mon" #> [21] "ws_mean_mon" "cloud_mean_mon"
abbr <- meteo_shortening(data = monthly, col_names = "short", remove_duplicates = TRUE) head(abbr)
#> rank id station yy mm tmax_abs tmax_mean tmin_abs #> 1716 KLIMATYCZNA 249220170 BALIGRÓD-MCHAWA 1969 1 9.0 -0.3 -24.2 #> 1720 KLIMATYCZNA 249220170 BALIGRÓD-MCHAWA 1969 2 9.0 1.6 -26.1 #> 1721 KLIMATYCZNA 249220170 BALIGRÓD-MCHAWA 1969 3 10.0 2.2 -17.0 #> 1722 KLIMATYCZNA 249220170 BALIGRÓD-MCHAWA 1969 4 24.5 10.9 -7.4 #> 1723 KLIMATYCZNA 249220170 BALIGRÓD-MCHAWA 1969 5 27.7 20.0 -1.0 #> 1724 KLIMATYCZNA 249220170 BALIGRÓD-MCHAWA 1969 6 25.5 18.8 3.8 #> tmin_mean t2m_mean_mon t5cm_min rr_monthly rr_max_daily first_day_max_rr #> 1716 -10.9 -5.5 0 10.8 6.8 24 #> 1720 -5.7 -2.3 0 25.9 6.9 3 #> 1721 -5.6 -1.6 0 25.2 9.2 27 #> 1722 -0.2 5.6 0 56.6 13.0 14 #> 1723 7.1 14.3 0 76.0 36.6 29 #> 1724 9.5 14.4 0 137.6 39.9 8 #> last_day_max_rr snowcover_max snowcover_days rain_days snow_days #> 1716 NA 17 24 1 5 #> 1720 NA 13 20 4 5 #> 1721 NA 11 17 2 12 #> 1722 NA 11 9 5 5 #> 1723 NA 0 0 11 0 #> 1724 NA 0 0 19 0 #> rh_mean_mon ws_mean_mon cloud_mean_mon #> 1716 0 1.5 4.2 #> 1720 0 1.0 5.6 #> 1721 0 1.1 5.4 #> 1722 0 1.1 3.6 #> 1723 0 1.3 3.6 #> 1724 0 1.2 5.7