I have a very basic question:
I have a dataframe like so:
> head(xxx)
# A tibble: 6 x 2
perim no
<chr> <chr>
1 NA 9999-048
2 VALUE 1 9999-048
3 NA 9999-048
4 NA 9999-048
5 NA 9999-041
6 VALUE 2 9999-041
I have a grouping variable, no
and I want to assign each element in perim
with the corresponding value, with currently only one observation per no
-group having a value. My desired result would look like this:
perim no
<chr> <chr>
1 VALUE 1 9999-048
2 VALUE 1 9999-048
3 VALUE 1 9999-048
4 VALUE 1 9999-048
5 VALUE 2 9999-041
6 VALUE 2 9999-041
I know there must be an easy way to go about this, but I seem to be stuck. Any help is very appreciated!