4.1 R Scripts

Suppose you were writing an R script and had a variable called "x". What line of code would you use to display that variable from *within* the script?

print(x)


Suppose you were writing an R script and made a ggplot2 plot, using the line ggplot(diamonds, aes(x=carat, y=price)) + geom_point(). What line of code would you use to display that plot from within the script?

print(ggplot(diamonds, aes(x=carat, y=price)) + geom_point())