1

I want to execute a code on R that has been stored as a character.

For example, imagine I have this code:

library(ggplot2)
plot <- "ggplot(iris,aes(Sepal.Length))+geom_histogram()"

I know that the correct way is to store this:

plot <- ggplot(iris,aes(Sepal.Length))+geom_histogram()

whitout quotes, but this is not what I have, so..

How can I adress to plot the chart I want if I have the code with quotes? How can I plot

  plot <- "ggplot(iris,aes(Sepal.Length))+geom_histogram()"

Thanks!

Jesus
  • 462
  • 6
  • 13

0 Answers0