We are receiving this error because of incompatibility in the Version of R you are using and the one we used while preparing the solution for Assignment.

 

In the assignment we have used R-3.1 version which will consider sequence numbers as column X when the data set is loaded in R as in the below screenshot. But this does not happen in the latest versions of R.


Hence to overcome this issue, I have added a column in the data set. 


Can you please try to run this Assignment solution using the data set in the attachment and check.


Hope this helps you.