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/Rtmp95w7yv/file17d079d6258
#> /tmp/Rtmp95w7yv/file17d046d1006d
#> /tmp/Rtmp95w7yv/file17d048ccaa89
  
  if (is.data.frame(monthly)) {
  abbr = hydro_shortening_imgw(data = monthly,
      col_names = "full",
      remove_duplicates = TRUE)
  head(abbr)
  }
#>           ID Station River_or_Lake       Date Hydrologic year
#> 1  151160130 ?CINAWA      Odra (1) 1968-11-01            1969
#> 2  151160130 ?CINAWA      Odra (1) 1968-11-01            1969
#> 3  151160130 ?CINAWA      Odra (1) 1968-11-01            1969
#> 4  151160130 ?CINAWA      Odra (1) 1968-12-01            1969
#> 5  151160130 ?CINAWA      Odra (1) 1968-12-01            1969
#> 6  151160130 ?CINAWA      Odra (1) 1968-12-01            1969
#>   Hydrologic year ID Extreme ID [min - 1, mean - 2, Max - 3] State [cm]
#> 1                  1                                       1         NA
#> 2                  1                                       2         NA
#> 3                  1                                       3         NA
#> 4                  2                                       1         NA
#> 5                  2                                       2         NA
#> 6                  2                                       3         NA
#>   Flow [m3_s] Temperature [C] Month
#> 1     141.000              NA    11
#> 2     225.033              NA    11
#> 3     362.000              NA    11
#> 4      95.200              NA    12
#> 5     178.387              NA    12
#> 6     242.000              NA    12
# }