scrubber function

Clean Imported Text

Clean Imported Text

Use to clean text variables when importing a new data set. Removes extra white spaces other textual anomalies that may cause errors.

scrubber( text.var, num2word = FALSE, rm.quote = TRUE, fix.comma = TRUE, fix.space = TRUE, ... )

Arguments

  • text.var: The text variable.
  • num2word: logical If TRUE replaces a numbers with text representations.
  • rm.quote: logical If TRUE removes any \".
  • fix.comma: logical If TRUE removes any spaces before a comma.
  • fix.space: logical. If TRUE extra spaces before endmarks are removed.
  • ``: Other arguments passed to replace_number.

Returns

Returns a parsed character vector.

Examples

## Not run: x <- c("I like 456 dogs\t , don't you?", 'The end"') scrubber(x) scrubber(x, TRUE) ## End(Not run)

See Also

strip

  • Maintainer: Tyler Rinker
  • License: GPL-2
  • Last published: 2023-05-11