You can compute rpkm from a
DESeqDataSet in the way indicated in @igor's answer. However, RPKMs should only be used for downstream analysis and not for testing differential expression. This is explicitly mentioned in the documentation of DEseq2.
In order to test for differential expression, we operate on raw counts and use discrete distributions as described in the previous Section 1.4. However for other downstream analyses – e.g. for visualization or clustering – it might be useful to work with transformed versions of the count data.
Same is said in the documentation for the older package DEseq:
The count values must be raw counts of sequencing reads. This is important for DESeq’s statistical model to hold, as only the actual counts allow assessing the measurement precision correctly. Hence, please do do not supply other quantities, such as (rounded) normalized counts, or counts of covered base pairs – this will only lead to nonsensical results.
Other relevant discussion: