• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Unifying variable level names based on manual entry text variations in R

Resolved: Unifying variable level names based on manual entry text variations in R

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

The data I am using are based on self completed, mannually entered text responses to a questionnaire.
The problem is, especially with regards to fish species, people abbreviate, call them by different names, spell things wrong, etc.
How do I take all of the related names in a series of three columns and make them into one unified name so that I can perform analysis on them?
For example: “black tail”, “blacktail”, “Black Tail”, “Blacktail” etc. could all be renamed “blacktail” “Steenies”, “steenbras”, “steenie”, “steambras” -> “Steenbras”
Is there a way to do this using partial string matching to save time/effort?
I know how to manually rename each one, however, there are over 150 rows in the full data and having to find and rename each unique variation can be tedious to say the least. Additionally, data entries are ongoing so the list of inaccurately entered species names will likely continue to grow.
Update:
full df minus some rows
I have tried the method suggested in the comments below regarding the tidyverse solution but it doesn’t change the names… at all. Not sure why.

Answer:

Probably not optimal, but it works.
Created on 2022-06-16 by the reprex package (v2.0.1)

If you have better answer, please add a comment about this, thank you!

dplyr grep r rename tidyverse
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Modify entity using Action in C#

24/03/2023

Resolved: How to give rank on datetime column group by another column with userid in it

24/03/2023

Resolved: Passing 2 functions in onChange in react

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.