Project organization
-
Start RStudio.
- Create a new project in your Desktop called
ml-biomed.- Click the
Filemenu button, thenNew Project. - Click
New Directory. - Click
New Project. - Type
ml-biomedas the directory name. Browse to your Desktop to create the project there. - Click the
Create Projectbutton.
- Click the
-
Use the
Filestab to create adatafolder to hold the data, ascriptsfolder to house your scripts, and aresultsfolder to hold results. Alternatively, you can use the R console to run the following commands for step 2 only. You still need to create a project with step 1.dir.create("./data") dir.create("./scripts") dir.create("./results")
Package installation and data access
-
Install R packages and load the libraries. You might already have some of these installed. Search for their names in the
Packagestab in RStudio. There is no need to install them again if you find them there.install.packages("devtools", "rafalib", "RColorBrewer", "gplots", "UsingR", "class", "caret") library(devtools) library(rafalib) library(RColorBrewer) library(gplots) library(UsingR) library(class) library(caret) -
Install the tissue gene expression data from Github then load the library and data. If you were successful installing and loading
devtoolsabove, you should be able to install from Github.install_github("genomicsclass/tissuesGeneExpression") library(tissuesGeneExpression) data(tissuesGeneExpression)The data represent RNA expression levels for eight tissues, each with several individuals.
Alternatively, download the data directly from Github and place them in your new
datadirectory. Do this if installingdevtoolsor installing from Github gave you difficulty. -
Load packages from Bioconductor.
if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install(c("genefilter", "Biobase", "SpikeIn", "hgu95acdf") library(genefilter) library(Biobase) library(SpikeIn) library(hgu95acdf) data(SpikeIn95)