Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
volcano
You get a big barf load of numbers in your R interpreter window. This is enough to send lots of people running back to Excel as fast as they can say ‘Bill Gates.’ Ok, admittedly that isn’t nice to look at. If you want to view your data in a more visually appealing way you can use the View command (make sure your capitalize the ‘V’).
View(volcano)
Now things look more like they do in a spreadsheet. If you’re on a Windows machine this is really works well, you’ll probably have a scrollable window pop up with slider bars and everything. On Mac OS it’s a little more janky. You’ll get an X11 window that you can use your arrow keys to navigate around.
Ok, looking good! What if you’ve loaded in your data, you’re looking it over and you see an error (misspelling maybe)? Do you have to open up your file in Excel, fix it, and re-save it as a csv, and then open it up again in R? No. No you don’t. You can use the fix command (but have care, things can get confusing this way).
volcanoII < - fix(volcano)
will allow you to open up an editable window, make changes by clicking the error with your mouse, and typing in the correction. The changes will be saved in a new data frame called volcanoII (because that's what you typed on the left side of the < - ). Here is the caveat, the data edits aren't saved in the original file, just in R. If you want to save a copy of your edited data frame, you'll have to write out a file from R (use write.table). Alright, hopefully this pushes you a little farther towards dumping your spreadsheet program for data analysis.
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.