Describe a situation where you had to use string manipulation functions in R for data cleaning.

  • Removing leading and trailing whitespaces from strings
  • Converting strings to a consistent case
  • Replacing certain patterns in strings
  • All of the above
All the options are valid situations where string manipulation functions in R might be used for data cleaning. For example, trimws() can be used to remove leading and trailing whitespaces, tolower() or toupper() can be used to convert strings to a consistent case, and gsub() can be used to replace certain patterns in strings.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *