Skip to content

Overview of Analysis in R

Mark edited this page Oct 12, 2017 · 23 revisions

Purpose

This page defines my data analysis goals and provides guidelines for how these are are implemented, specifically in R-Studio. It is a description of file structure of data and analysis scripts, as well as my workflow in R-Studio. For relevant background, see [r, r studio guide][Guide: R,R studio]

File Structure

Folders _original_data - .csv, .xlsx, .emerge files for visual inspection and r.
archive_content - Historical r scripts, coding, and data structures.

Files
.Rproj - Open this first.
name_analysis.r - Open this within R-Studio (within the project environment).
name_data.rda - data file to be used with the analysis.R file.

name_data_structures.R - file used to generate cleaned data structures (.rda files). Dependents: .csv files in _original_data

Analysis

  1. Open (double-click) the .Rproj file. If it opens in R-Studio, it should set the working directory to the current folder.
  2. In R-Studio, navigate to the File tab on the bottom-right panel (default position). Open name_analysis.r from here.
  3. Run the code from this .r script through the library-loading, and data structure loading commands. Something like this:
library("ddply")
library("lmSupport")
# Here are some notes about what this script does.
load("datastructure.rda")
  1. Run lines of analyses.

Clone this wiki locally