Unify two vectors preserving the order of x
unify_vec_preserve_order.Rd
Unify two vectors preserving the order of x
Arguments
- x
vec
to preserve the order of- y
vec
to vector of values to include in the output (unordered)
See also
Other vectors:
len_unique()
,
names_values_switch()
,
rle_df()
,
rle_groups()
,
rle_seq()
,
sort_by_names()
,
true_names()
,
unique_with_names()
,
vlookup()
,
vlookup_from_ref()
,
zchar_remove()
Examples
unify_vec_preserve_order(letters[c(5, 3)], letters[c(4:10,3)])
#> [1] "e" "c" "d" "f" "g" "h" "i" "j"
unify_vec_preserve_order(letters[1:5], letters[c(4:10)])
#> [1] "f" "g" "h" "d" "e" "i" "j"
unify_vec_preserve_order(NULL, letters[c(4:10)])
#> [1] "d" "e" "f" "g" "h" "i" "j"
unify_vec_preserve_order(letters, NULL)
#> NULL