text: user8910: I run plotPCA for single cell RNA-seq data, while I get error message (I use R 4.0). I attached the code and error message here. Did anyone know the reason and how to deal with it. Thanks!
  library(pcaMethods)
  library(SC3)
  library(scater)
  library(SingleCellExperiment)
  library(pheatmap)
  library(mclust)
  set.seed(1234567)
  deng <- readRDS("deng-reads.rds")
  plotPCA(deng, colour_by = "cell_type2")
  
  Error in value[[3L]](cond) : invalid subscript 'type' in 'reducedDimNames(<SingleCellExperiment>)'
  'PCA' not in 'reducedDimNames(<SingleCellExperiment>)'
  
  I also get error message when I run the code as below: 
  colData(deng)$tSNE_kmeans <- as.character(kmeans(deng@reducedDims$TSNE, centers = 8)$clust)
  
  # Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : 'data' must be of a vector type, was 'NULL'
  
  
  user-1: The error is pretty obvious. There is no PCA data in the respective slot of the SingleCellExperiment that plotPCA could use, at least it is not called PCA which by default is expected. Use runPCA first, please read the manuals of scater and scran first, they have step-by-step code.
  
original_text: 8910: <p>I run plotPCA for single cell RNA-seq data, while I get error message (I use R 4.0). I attached the code and error message here. Did anyone know the reason and how to deal with it. Thanks!</p>
  
  <pre><code>library(pcaMethods)
  library(SC3)
  library(scater)
  library(SingleCellExperiment)
  library(pheatmap)
  library(mclust)
  set.seed(1234567)
  deng &lt;- readRDS("deng-reads.rds")
  plotPCA(deng, colour_by = "cell_type2")
  </code></pre>
  
  <pre><code>Error in value[[3L]](cond) : invalid subscript 'type' in 'reducedDimNames(&lt;SingleCellExperiment&gt;)'
  'PCA' not in 'reducedDimNames(&lt;SingleCellExperiment&gt;)'
  </code></pre>
  
  <p>I also get error message when I run the code as below: </p>
  
  <pre><code>colData(deng)$tSNE_kmeans &lt;- as.character(kmeans(deng@reducedDims$TSNE, centers = 8)$clust)
  </code></pre>
  
  <pre><code># Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : 'data' must be of a vector type, was 'NULL'
  </code></pre>
   -1: <p>The error is pretty obvious. There is no PCA data in the respective slot of the SingleCellExperiment that <code>plotPCA</code> could use, at least it is not called <code>PCA</code> which by default is expected. Use <code>runPCA</code> first, please read the manuals of <code>scater</code> and <code>scran</code> first, they have step-by-step code.</p>
  