Let's say I have a factorial variable x.fine
which is too fine for analysis (too many levels), and I want to reduce the number of levels by creating a reference table translating x.fine
to a new variable x.coarse
(which I haven't developed yet).
I could open up Excel or OpenRefine and start creating the lookup values interactively, export the table as CSV and import for a join in R. Since I have to create the table only once and it will be included in the analysis, reproducibility is guaranteed.
But is there a simple way to create such a reference table without leaving R/RStudio?
EDIT: Changed title (replaced "interactive" with "user-friendly")