View source: R/watanabe-df-manipulation.R
recodeCol | R Documentation |
Recodes elements of a column according to a conversion table and writes them to a new column. Will resort the rows in df
.
recodeCol(df, colName, convertTable, destName = NULL)
df |
A data frame |
colName |
Name of column to code |
convertTable |
Data frame containing conversation scores. Should contain two columns: oldValue and newValue. The table must have as many rows as there are unique values in |
destName |
Character vector. Name of new column to write recoded data to. May not already ben the name of a column in |
The original data frame with the new column scoreName
containing the results of scoring colName
with scoreTable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.