Step 2 Setting up

2.1 Install packages

# Uncomment the following lines if you haven't installed snpStats 
#if (!require("BiocManager", quietly = TRUE))
    #install.packages("BiocManager")
#BiocManager::install("snpStats")
library(snpStats)
library(dplyr)
library(ggplot2)
library(broom)

2.2 Import Hapmap dataset

#Modify the file paths as yours
fpath <- '/Users/apple/OneDrive - macalester.edu/Fall2022/STAT 494/data/1_QC_GWAS/HapMap_3_r3_1'
fam <- paste0(fpath, '.fam')
bim <- paste0(fpath, '.bim')
bed <- paste0(fpath, '.bed')
hapmap <- read.plink(bed, bim, fam)