dwayne
dwayne

Reputation: 1

RStudio Scatter plot Error: unexpected symbol in "Scatter plot

I doing an exerise on RStudio [https://www.slideshare.net/thoi_gian/iris-data-analysis-with-r][1]

tried below command im getting Error: unexpected symbol in "Scatter plot"

Scatter plot plot(iris, col=iris$Species) legend(7,4.3,unique(iris$Species),col=1:length(iris$Species),p ch=1) Lattice library Ggplot2 library

Upvotes: 0

Views: 856

Answers (1)

Eric
Eric

Reputation: 1701

You have copied too much text from the slideshare slide, and as a result you are getting the error because that is not proper syntax. The following should work:

data(iris)
plot(iris, col=iris$Species)

Upvotes: 0

Related Questions