Installing R for Ruby using Homebrew
Here's how to install R using Homebrew.
Step 1 - XCode Command line
If you're on a Mac, you will need to install XCode command-line tools.
Step 2 - Homebrew
Homebrew is a package manager for Mac and if you haven't installed it yet, follow this tutorial.
Step 3 - Science FormulÃ¦
We will need to install the scientific formulae using Homebrew Science.
brew tap homebrew/science
Step 4 - xQuartz
You need to install xQuartz using Homebrew Cask extension.
brew install cask
brew install caskroom/cask/xquartz
Step 5 - R
Finally, we can install R!
brew install r
Step 6 - TK Graphic Library
Let's be safe and install Homebrew Dupes which will allow you to have a duplicate on homebrew.
brew tap homebrew/dupes
Install the TK Graphical Library.
brew cask install tcl
Step 7 - Double Check Your Work
Running Doctor will ensure your system is stil healthy
brew cask doctor
Cleanup any files.
brew cask cleanup
Step 8 - Run R
If everything is working properly, you should be able to run
R (notice that it's capital) and the
TK GUI. This GUI is what you will be using to visualize your statistical questions.
R -g Tk &
R uses a package manager to help organize open source libraries. The most popular library is Comprehensive R Archive Network and within in, is a graphic package called
ggplot2 is a graphic package based on the idea of composing plots using multiple layers that can be stacked on top of each other. Think, Photoshop for big data. There are many other graphic packages such as
qplot (quick plot) but it's just easier to learn
ggplot2 once and for all.
ggplot2 through CRAN
ggplot2 into your