DataEditR: The GUI for Interactive Dataframe Editing in R
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
This article is part of R-Tips Weekly, a weekly video tutorial that shows you step-by-step how to do common R coding tasks.
Here are the links to get set up. ?
DataEditR Video Tutorial
For those that prefer Full YouTube Video Tutorials.
Learn how to use DataEditR
in our free YouTube video.
Watch our full YouTube Tutorial
GUI for Editing Dataframes in R
Edit dataframes as if they were Excel tables.
DataEditR
is a great addition to the R package ecosystem. I see it being immediately useful for beginners coming from Excel where they are used to being able to edit data interactively in an Excel Worksheet.
Find out how easy it is to edit data with the DataEditR GUI (Graphical User Interface).
BONUS:
I have an extra ggplot2
code showing boxplots of the Fuel Economy at the end of the tutorial (a vision of where you can go once you learn R beyond the GUI).
Beginners Struggle with R
Simple tools like DataEditR can make your transition much easier.
One of my biggest challenges when I moved from Excel
to R
was the transition from an interactive worksheet where I could edit data using point-click-edit to a data frame that requires code to edit. This was a serious hurdle. I wish I had a tool like DataEditR
when I was first starting out.
Fast-forward to 2021, and here we are: DataEditR
, the GUI I never had. Today, you’ll learn how to use this Excel-style dataframe editing tool.
Image Source:
DataEditR GitHub
Before we get started, get the R Cheat Sheet
DataEditR
is great for making simple edits. But, you’ll still need to learn how to wrangle data with dplyr
and visualize data with ggplot2
. For those topics, I’ll use the Ultimate R Cheat Sheet to refer to dplyr
and ggplot2
code in my workflow.
Quick Example:
Download the Ultimate R Cheat Sheet Then Click the “CS” next to “ggplot2” opens the Data Visualization with GGplot2 Cheat Sheet.
Now you’re ready to quickly reference ggplot2
functions.
Onto the tutorial.
How DataEditR works
It’s super-simple. Just run this code to:
- Load Libraries: Load
DataEditR
,tidyverse
andtidyquant
. - Import Data: We’re using the
mpg
dataset that comes withggplot2
. - Start Data Editing: Use the
data_edit()
function.
This launches the Data Editor.
The Data Editor
Try Editing Cells
Click on a cell and make any edits.
Editing Cells
Try Selecting Columns
Click the target icon. Then select columns you are interested in.
Selecting Columns
When you’re done, save a CSV
After you’ve made your edits, you can optionally save a CSV File. Alternatively, you can return a data frame in your active R Session.
Save as CSV File
Going Further
with dplyr
and ggplot2
DataEditR
is great for making simple edits. But, eventually you’re going to need to go further by using code to wrangle data and prepare visualizations. For this, I’ll circle back to dplyr
and ggplot2
, and my Ultimate R Cheat Sheet.
Fuel Economy by Vehicle Model
Say that you wanted to make a visualization that shows the differences in vehicle models and their fuel economy measured as miles per gallon (MPG). We can do this with dplyr
and ggplot2
.
Visualization and Insights
The code makes a stunning ggplot2
visualization that highlights the differences in fuel economy by vehicle model and class. We can see:
- SUV’s clearly have the lowest fuel economy although the Subaru Forester AWD seems to be an outlier.
- Toyota Corolla is leading the pack with Highway MPG in the mid-30s.
In Summary
You’ve seen how DataEditR
can be used for making simple edits inside of R. You’ve also seen that learning dplyr
and ggplot2
can generate insights through visualizations.
What if you want to go further? Read on.
My Struggles with Learning Data Science
At the beginning of the article, I talked briefly about my struggles learning R. It took me a long time. And I made a lot of mistakes as I fumbled through learning R. I specifically had a tough time navigating the ever increasing landscape of tools and packages, trying to pick between R and Python, and getting lost along the way.
If you feel like this, you’re not alone.
In fact, that’s the driving reason that I created Business Science and Business Science University (You can read about my personal journey here).
What I found out is that:
-
Data Science does not have to be difficult, it just has to be taught smartly
-
Anyone can learn data science fast provided they are motivated.
How I can help
If you are interested in learning R and the ecosystem of tools at a deeper level, then I have a streamlined program that will get you past your struggles and improve your career in the process.
It’s called the 5-Course R-Track System. It’s an integrated system containing 5 courses that work together on a learning path. Through 5+ projects, you learn everything you need to help your organization: from data science foundations, to advanced machine learning, to web applications and deployment.
The result is that you break through previous struggles, learning from my experience & our community of 2000+ data scientists that are ready to help you succeed.
Ready to take the next step? Then let’s get started.
? Top R-Tips Tutorials you might like:
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.