Shortening column names of hydrological parameters to improve the readability of downloaded dataset from the danepubliczne.imgw.pl collection and removing duplicated column names

hydro_shortening_imgw(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)

Value

data.frame with shorten names of hydrological parameters

Examples

# \donttest{
  monthly = data = hydro_imgw("monthly", year = 1969, col_names = "polish")
#>     Your system locale is: C.UTF-8 which may cause trouble.
#>     Please consider changing it manually while working with climate, e.g.:
#>     Sys.setlocale(category = 'LC_ALL', locale = 'en_US.UTF-8') 
#> /tmp/RtmpWCv8r5/file15e861e2987c
#> /tmp/RtmpWCv8r5/file15e828a1424c
#> /tmp/RtmpWCv8r5/file15e8103d8f3
  
  if (is.data.frame(monthly)) {
  abbr = hydro_shortening_imgw(data = monthly,
      col_names = "full",
      remove_duplicates = TRUE)
  head(abbr)
  }
#>              ID Station River_or_Lake Hydrologic year Hydrologic year ID
#> 7165  150210180 ANNOPOL     Wisla (2)            1969                  1
#> 7166  150210180 ANNOPOL     Wisla (2)            1969                  1
#> 7167  150210180 ANNOPOL     Wisla (2)            1969                  1
#> 7168  150210180 ANNOPOL     Wisla (2)            1969                  2
#> 7169  150210180 ANNOPOL     Wisla (2)            1969                  2
#> 7170  150210180 ANNOPOL     Wisla (2)            1969                  2
#>      Extreme ID [min - 1, mean - 2, Max - 3] State [cm] Flow [m3_s]
#> 7165                                       1        258     288.000
#> 7166                                       2        287     413.266
#> 7167                                       3        323     582.000
#> 7168                                       1        239     188.000
#> 7169                                       2        270     316.806
#> 7170                                       3        296     452.000
#>      Temperature [C] Month
#> 7165              NA    11
#> 7166              NA    11
#> 7167              NA    11
#> 7168              NA    12
#> 7169              NA    12
#> 7170              NA    12
# }