Message-ID: <CAJaXYsNM1x9tiX7-C3bpgt=+Y5xHm4ehehVnSrusr_rVqcjzZQ@mail.gmail.com>
Date: 2018-05-20T23:05:25Z
From: STEVEN MANCINI
Subject: Loop Function to Create Multiple Scatterplots
Hello,
I am trying to create multiple scatter plot graphs. I have 1 independent
variable (Age - weeks post conception) and 18 dependent variables ("Gene n"
Expression) in one csv file. Is there a way to set up a looped function to
produce 18 individual scatterplots? At the moment, I am writing the plot()
function out 18 times to make the 18 graphs. My code is below and csv file
is attached.
*Code*
wd <- setwd("~/Dropbox/Steve/SM Research Projects/Allen Brain Bank
Project/Allen Brain Bank Inflammatory Markers Project Matlab:R/Other/2018
Tests")
list.files(wd)
mydata <- read.csv("Glutamate.Genes.V1.csv")
mydata
plot(mydata$Age..weeks.post.conception., mydata$GluA1..GRIA1..Expression)
plot(mydata$Age..weeks.post.conception.,
mydata$GluA2..GluR2.GRIA2..Expression), etc
Thank you for your time and help.
Regards,
Steven