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') 
#> https://danepubliczne.imgw.pl/data/dane_pomiarowo_obserwacyjne/dane_hydrologiczne/miesieczne/
#> https://danepubliczne.imgw.pl/data/dane_pomiarowo_obserwacyjne/dane_hydrologiczne/miesieczne/MIES_publiczne_format.txt
#> https://danepubliczne.imgw.pl/data/dane_pomiarowo_obserwacyjne/dane_hydrologiczne/miesieczne/1969/mies_1969.zip
  
  if (is.data.frame(monthly)) {
  abbr = hydro_shortening_imgw(data = monthly,
      col_names = "full",
      remove_duplicates = TRUE)
  head(abbr)
  }
#>      PSKDSZS  PSNZWP   KDNRZK       Date MCROKH MCMSCH MCWSKEX MCSTAN  MCPRZP
#> 1  151160130 ?CINAWA Odra (1) 1968-11-01   1969      1       1     NA 141.000
#> 2  151160130 ?CINAWA Odra (1) 1968-11-01   1969      1       2     NA 225.033
#> 3  151160130 ?CINAWA Odra (1) 1968-11-01   1969      1       3     NA 362.000
#> 4  151160130 ?CINAWA Odra (1) 1968-12-01   1969      2       1     NA  95.200
#> 5  151160130 ?CINAWA Odra (1) 1968-12-01   1969      2       2     NA 178.387
#> 6  151160130 ?CINAWA Odra (1) 1968-12-01   1969      2       3     NA 242.000
#>   MCPTMP MCMSCK
#> 1     NA     11
#> 2     NA     11
#> 3     NA     11
#> 4     NA     12
#> 5     NA     12
#> 6     NA     12
# }