Error in ML technique

I am getting an output when I run CART !

trainDS$prediction = predict(ptree, data=trianDS, type="class")

But no error.

is there a question?

I should be getting a table of dataset with prediction coloumn. Instead I tam getting that

How would this relate to something called cartmodel ?

Assuming you transform with some steps from the former to the latter. The cartmodel object is full of objects. You could try to call summary() on it. You could look at the frame part of it carmodel$frame.

Yes thats not not the code for cart model. i mentioned it coz that probably give some understanding on the question. Also, table was fine until i run the above code. but i was trying to predict the train data on test data. summary () command gives the 5 number summary output. I am unable to view the dataset using View().

I got the above output when I ran View() code, which dosent make sense.