Description Usage Arguments Value Examples
View source: R/fun_logic_assg.r
Logical assignment, a MJP team defined function
1 | fun_logic_assg(x, reference, typo_col = "TYPO", replace_col = "REPLACEMENT")
|
x |
A input variable/ column/ vector of strings to perform the logical assignment on |
reference |
A reference table (lookup table) having at least 2 column for matching the typo and returning the replacement |
typo_col |
The name ( as a "character") of the column in the reference table that allows the function to match with the input column "x" |
replace_col |
The name (as a "character) of the column in the reference table that contains the coresponding values to be returned. |
A vector (character) that contains the replacement values from the reference table
1 2 | ref_table <- data.frame(cars = rownames(mtcars), cyl = mtcars$cyl)
fun_logic_assg(rownames(mtcars) , ref_table, typo_col = "cars", replace_col = "cyl")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.