I have a large set of RNA-seq expression data in a DGEList object, and I want to plot the epxression data between two factors for specific genes temporally. 

I started out by subsetting the data into a smaller matrix and then realised that was silly, and I should be able to plot it from the DGEList object that the data is stored in. Each timepoint has three replicates so I would also be looking to take a mean of those replicates before plotting. Would subsetting the data first still be the best option or am I missing a far quicker and easier option. 

DGEList Count:

    Gene Symbol   Sample1 Sample2 Sample3 Sample4 Sample5 Sample6 Sample7 Sample8 ...
    Gene1           54     55       53      78      79      74      81      82
    Gene2           23     21       22      45      44      47      61      62     
    Gene3           74     75       73      81      82      80      83      88
    Gene4            2      3        1      10       9       8      12      11
    ...

MetaData:

           Sample Name ...    Day
    [1,]    Sample1            D0
    [2,]    Sample2            D0
    [3,]    Sample3            D0
    [4,]    Sample4            D3
    [5,]    Sample5            D3
    [6,]    Sample6            D3
    [7,]    Sample7            D7
    [8,]    Sample8            D7
    ...

Using the examples above, what I am trying to do is draw an expression line plot for Gene 2 and Gene 3, including averaging the expression levels on each day - but as I have two factors the samples come from two factors and so would need to be separate,
Okay, I get the feeling that this does not have to be anything special for now (in terms of a 'polished' plot). So, you could try this:

    df
            time gene1 gene2 gene3
    sample1 day1     1     2     3
    sample2 day1     4    10     3
    sample3 day2     1     2     3
    sample4 day2     1     2     3
    sample5 day3     1     2     3
    sample6 day3     1     2     3

Summarise by mean:

    df <- aggregate(df[,2:ncol(df)], df[1], mean)
    df
      time gene1 gene2 gene3
    1 day1   2.5     6     3
    2 day2   1.0     2     3
    3 day3   1.0     2     3

Plot

    plot(1, type="n", ylab="Expression", xlab="Day (1, 2, 3)", xlim=c(1,3), ylim=c(0,10))
    lines(gene1 ~ time, data=df, lwd=2, col="royalblue")
    lines(gene2 ~ time, data=df, lwd=2, col="red4")
    lines(gene3 ~ time, data=df, lwd=2, col="forestgreen")

<a href="https://ibb.co/hP4FU7"><img src="https://preview.ibb.co/mOG7bn/d.png" alt="d" border="0"></a>

