resSig <- subset(res, res$padj < 0.05 )  
Using this code i create a vector resSig
head( resSig[ order( resSig$log2FoldChange ), ], 500)
I print top 500 genes
 baseMean log2FoldChange     lfcSE      stat       pvalue         padj
                 <numeric>      <numeric> <numeric> <numeric>    <numeric>    <numeric>
ENSG00000096006   1987.812       -14.1212  1.286311 -10.97807  4.87215e-28  5.77837e-25
ENSG00000170477 125694.012       -11.3416  0.519680 -21.82421 1.36677e-105 1.37784e-101
ENSG00000143536   7731.399       -11.2569  1.504429  -7.48249  7.29248e-14  7.90489e-12
ENSG00000016602   5531.968       -10.5545  0.417882 -25.25705 9.47707e-141 1.91077e-136
ENSG00000178690    151.547       -10.4074  1.255369  -8.29030  1.12959e-16  2.01547e-14
...                    ...            ...       ...       ...          ...          ...
Now, I am trying to export this data to a csv file
 
     
    