Skip to content

Commit

Permalink
fix: remove duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
bczernecki committed Oct 29, 2024
1 parent d858cf8 commit 0620a7a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R/hydro_shortening_imgw.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ hydro_shortening_imgw = function(data,
if (remove_duplicates == TRUE) {
data = data[, !duplicated(colnames(data))]
}

data = unique(data)
rownames(data) = NULL
return(data)
}
3 changes: 2 additions & 1 deletion R/meteo_shortening_imgw.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ meteo_shortening_imgw = function(data, col_names = "short", remove_duplicates =
colnames(data)[orig_columns %in% abbrev$fullname] = abbrev$fullname_eng[matches]
}
}

data = unique(data)
rownames(data) = NULL
return(data)
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ head(m)
h = hydro_imgw(interval = "daily", year = 2010:2011)
head(h)
id station riv_or_lake hyy idhyy dd H Q T mm thick id_ice p_ice
97843 150210180 ANNOPOL Wisła (2) 2010 1 1 287 436 NA 11 NA NA NA
507527 150210180 ANNOPOL Wisła (2) 2010 1 1 287 436 NA 11 NA NA NA
97844 150210180 ANNOPOL Wisła (2) 2010 1 2 282 412 NA 11 NA NA NA
507528 150210180 ANNOPOL Wisła (2) 2010 1 2 282 412 NA 11 NA NA NA
97845 150210180 ANNOPOL Wisła (2) 2010 1 3 272 368 NA 11 NA NA NA
507529 150210180 ANNOPOL Wisła (2) 2010 1 3 272 368 NA 11 NA NA NA
id station riv_or_lake date hyy idhyy dd H Q T mm thick
1 150210180 ANNOPOL Wisła (2) 2009-11-01 2010 1 1 287 436 NA 11 NA
2 150210180 ANNOPOL Wisła (2) 2009-11-02 2010 1 2 282 412 NA 11 NA
3 150210180 ANNOPOL Wisła (2) 2009-11-03 2010 1 3 272 368 NA 11 NA
4 150210180 ANNOPOL Wisła (2) 2009-11-04 2010 1 4 268 352 NA 11 NA
5 150210180 ANNOPOL Wisła (2) 2009-11-05 2010 1 5 264 336 NA 11 NA
6 150210180 ANNOPOL Wisła (2) 2009-11-06 2010 1 6 260 320 NA 11 NA
```

## Example 5
Expand Down

0 comments on commit 0620a7a

Please sign in to comment.