I created a dataset in excel and then I saved it to my computer as a .csv and was able to import it into R. I can use the view() function, but whenever I try to manipulate the dataset, I get the message:
Error: Problem with mutate() input Total_wins. object 'Home_win' not found
And whenever I try to use it with ggplot, I get the following message:
Error in as.data.frame.default(x[[i]], optional = TRUE) :
cannot coerce class ‘c("LayerInstance", "Layer", "ggproto", "gg")’ to a data.frame
Please show the code you use to read in the data and your attempt to use the mutate() function. A sample of the data would also be useful. You can produce that with
dput(head(Home_win))
where I assume Home_win is the name of the data frame. You can format the pasted output nicely by putting a line with three back ticks, ```, just before and just after that pasted content, like this
```
output of dput here
```