Brief look at RCommander: Part 2. Let's load our data
Brief look at R Commander: Part 2, let's load some data.
So I was playing in RStudio on my Chromebook using RollApp and I discovered that R Commander works great. This allows me to write this from my Chromebook. This is much easier than being shackled to my office computer. As I write this, I fear these R Commander posts may turn into a long series, Part 1...15. This is not a bad thing, since I am working on revising a course and these could serve as useful exercises and notes. However, I do want to discuss some other stats issues in future posts. Anyway.....
To get R Commander going you simply open RStudio as I explained in Part 1. From RStudio (I am doing this in RollApp, but it works the same as if you are not in the cloud) you install the Rcmdr package as you normally would install a package. This might take a few minutes. Then I simply clicked the RCmdr boxes under User Library in the Packages Tab. This should result in R Commander opening automatically. Again, see Part 1.
Here we have the R Commander console (as you can see it is open in RollApp, cool eh?).
Loading packages and Rcmdr plug-ins
You can load your R packages as usual using RStudio, or using R. These will now be available for use in R Commander. There are some R Commander 'plug-ins' available. Information on these packages that can be found on the R Commander website. These are installed just as you would install any package in R or R Studio. Some of these are pretty amazing and I will highlight a few in future posts.
Loading data.
Loading data is fairly easy in R Commander. In fact, at this step you can see how powerfully built this program is. You can import a large variety of file formats including SPSS, SAS, STATA, etc:
Step 1: Select Data from menu and select file type. I will open an SPSS file:
Step 2: Name your datafile for use in R, default options are below:
Step 3: Select file to open. I am opening my file from my GoogleDrive:
You have now opened and imported your file. To view it select the 'View data set' button, highlighted in orange below. Also note, you can see the R code used to open the file in the box below. This is a handy way of learning how R works:
Once you select the view button, your datafile will be displayed in RStudio, as shown below. So, you will need to go back to that window to look at it:
There you have it! You are now ready to do some analyses.
To make these posts more consumable, I am making these posts fairly short. Upcoming posts will include:
Basic Stats, Models, R Markdown, and a few Rcmdr plug-ins.
Cheers!
Dislcaimer: I posted a blog about using RStudio in RollApp, and the RollAll folks gave me a membership trial. This post uses none of those features, however. The free version does all of what you have seen here. You can use RStudio from the cloud in other ways, including using R Studio server. See here for other examples. The advantage of RollApp is that it is easy and quick from their website (and the free version works), and it works on my Chromebook.
Comments
Post a Comment
Please comment if this helpful or if something went wrong. I take requests, so let me know if there is anything you would like me to demonstrate.