Can I move the files from the Data section of the Global Environment to the Values? The ones that were meant for Data went into the Values section and now nothing is graphing!

Hi Tyler, it's hard to figure out why your code runs an error, based on your minimal information (we have no clue how your data looks like, what your data represents and where the function cpm() cames from...!). I can just guess what happend... But your plot will definitely not appear if the input variable sdvec is missing.

To make it more easy to help you, please try to use reprex in future. Below is a link to a cool FAQ from Andrés, try it out :slight_smile:

So, now some reprex in action, based on your code. I have added a sample data set (just some random numbers) and also load the Bioconductor package 'edgeR' (I hope that's your cpm()-function). :wink:

#load library 
library(edgeR)
#> Lade nötiges Paket: limma

#set seed for the random numbers
set.seed(1234)
#sampling random numbers/counts (e.g. as example for your digital gene expression data loaded in R etc.)
y <- matrix(rnbinom(100,size=1,mu=10), ncol=2)

#compute cpm ('counts per million...?') and (natural) log-transform 
cpm.mat <- log(cpm(y))

#calculate mean/average out of the two replicates (each column represents a replicate...?) 
mean.vec <- apply(cpm.mat, 1, mean)
#calculate standard deviation/variability out of the two replicates
sdvec <- apply(cpm.mat, 1, sd)

#plot mean vs. standard deviation (set some plotting options)
plot(mean.vec, sdvec, main="2 replicates", ylab="sd", xlab="Average logCPM")

Created on 2019-02-08 by the reprex package (v0.2.1)

1 Like