Creating a graph but getting error message: unexpected symbol in... and can't find 'stat'

That should not make any difference once the data is in R

You have some mistakes in your syntax but first, I think we need to se some sample data.
See ?dput for a good way to supply some or have a look here for general hints on asking questions.