From a5a6cd0d56ee9418aae1d7a409d42bf3a860bbab Mon Sep 17 00:00:00 2001 From: Kai Guo Date: Thu, 3 Oct 2024 08:13:47 -0500 Subject: [PATCH] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a572ee2..168a817 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,11 @@ ft_insert(factor_vec, insert = c('date', 'grape'), positions = c(2, 4)) ft_insert(factor_vec, insert = 'honeydew', pattern = '^c') factor_vec_na <- factor(c('apple', NA, 'banana', 'cherry', NA, 'date')) ft_insert(factor_vec_na, insert = 'lychee', insert_after_na = TRUE) +# Insert 'date' and 'elderberry' after position 2 +factor_vec <- factor(c('apple', 'banana', 'cherry', 'fig', 'grape')) +new_factor <- ft_insert(factor_vec, insert = c('date', 'elderberry'), positions = 2,position = "after",inplace = FALSE) +# Insert 'kiwi' at position exceeding the number of levels +new_factor_exceed <- ft_insert(factor_vec, insert = 'kiwi', positions = 10, # Position exceeds number of levels position = "after", inplace = FALSE) ``` _ft_pairs_ Creates all unique pairwise combinations between factor_vec of a vector, with options for references, symmetry, NA handling, custom filtering, and output formats. Automatically handles factors by converting them to vectors and removes extra spaces from factor_vec before processing. ```{r}