0
genes.interes = c('MX1' ,"ACE2" , "ACAT1")
ggplot(data = datos, aes(x=positivity, y = MX1)) + geom_violin()
for (i in 1:3){
  gen = genes.interes[i]
  ploteo = ggplot(data = datos, aes(x=positivity, y =  datos [gen])) +
   geom_violin() + 
    ylab(paste(gen, "expression \n log2 (norm counts +1)"))
  print(ploteo)
}

And this is the error Don't know how to automatically pick scale for object of type data.frame. Defaulting to continuous. Error in is.finite(x) : default method not implemented for type 'list'

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
  • have you tried `aes_string(x = "positivity", y = gen)`? – teunbrand Jul 08 '21 at 22:19
  • Does this answer your question? [How to use a variable to specify column name in ggplot](https://stackoverflow.com/questions/22309285/how-to-use-a-variable-to-specify-column-name-in-ggplot) – Ronak Shah Jul 09 '21 at 01:38

0 Answers0