Description Usage Arguments Value See Also Examples
This function replaces abbreviations with long form.
1 2 3 4 5 6 | replace_abbreviation(
text.var,
abbreviation = qdapDictionaries::abbreviations,
replace = NULL,
ignore.case = TRUE
)
|
text.var |
The text variable. |
abbreviation |
A two column key of abbreviations (column 1) and long
form replacements (column 2) or a vector of abbreviations. Default is to use
qdapDictionaries's |
replace |
A vector of long form replacements if a data frame is not supplied to the abbreviation argument. |
ignore.case |
logical. If |
Returns a vector with abbreviations replaced.
bracketX
,
qprep
,
replace_contraction
,
replace_number
,
replace_symbol
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
x <- c("Mr. Jones is here at 7:30 p.m.",
"Check it out at www.github.com/trinker/qdap",
"i.e. He's a sr. dr.; the best in 2012 A.D.",
"the robot at t.s. is 10ft. 3in.")
replace_abbreviation(x)
#create abbreviation and replacement vectors
abv <- c("in.", "ft.", "t.s.")
repl <- c("inch", "feet", "talkstats")
replace_abbreviation(x, abv, repl)
(KEY <- rbind(abbreviations, data.frame(abv = abv, rep = repl)))
replace_abbreviation(x, KEY)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.