Note that this is the method used to analyze data from July 2012 through July 2016. Updated data analysis procedures are found here.
I analyze my data with an R kernel in Jupyter notebooks. A Jupyter notebooks is a document that contains executable code along with text and figures. Here is an example of one of my analysis notebooks.
- Setup Jupyter notebook
- Opening the Jupyter notebook
- My favorite R packages
- Data Day resources! (for Research Assistants)
Before you can analyze data, you must install the jupyter notebook. You can do this with conda
. The computer you are using should already be setup with miniconda. You can check whether the computer has miniconda by going to the terminal and typing the following:
conda info
If you get information about the current conda install, you can proceed. If you get a notice -bash: conda: command not found
, visit setting up a computer for instructions on installing miniconda before you proceed.
First we are going to create a conda enviroment for the Jupyter notebook with the packages required to run the R kernel. We will name the package jupyter.
conda create -n jupyter -c r r-essentials
Next we navigate to the new conda environment
source activate jupyter
And install jupyter into that environment
conda install jupyter
To exit the environment, type
source deactivate
To analyze data with Jupyter, you must activate the jupyter conda environment you created.
source activate jupyter
When you do this, you should see something like this appear in the terminal.
Once the jupyter environment is active, you can navigate to the analyses folder. (For research assistants, this is the 'Kschuler-current/analyses' folder in the learninglab Dropbox)
cd ~/Dropbox/Kschuler-current/analyses
And then open the jupyter notebook.
jupyter notebook
The notebook should be available at http://localhost:8888/ (or some other port number).
A browser will open with the jupyter notebook. You can click on any of the .ipynb
files to open that particular notebook.
%>%
dplyr
ggplot2
For research assistants attending the summer data analysis meeting (Mondays at 10:30!)