Fill This Form To Receive Instant Help
Homework answers / question archive / In this lab you will use the plot () function
In this lab you will use the plot () function. Use the Teams dataset from the Lahman package.
We would like to know whether offense or defense is a better predictor or a successful season. We will use the Hits variable to measure offensive power, the Earned Runs Average (ERA) to represent defense, and Wins to measure total games won in a season.
Submit your result as a PDF or HTML document. You will need to “knit” your.rmd file first.
Two hints:
To label points, you can use the identify() or locator() functions to find specific points.
Note that identify() requires the x-y variables as arguments, whereas locator() does not require arguments. Identify will return the row position of your data, which you can then use to subset your positions and labels:
text (x=dat$H[c(3,17)], y=dat$W [c(3,17)], labels=dat$teamID[c(3,17)] )
When knitting, you will need to include both a plot () function and a text () function in the SAME chunk of code, otherwise you will get an error.
Please use this google drive link to download the answer file.
https://drive.google.com/file/d/1kWMaXAfWqtHdcdHafjFoEa8aJin1JkTN/view?usp=sharing
Note: If you have any trouble in viewing/downloading the answer from the given link, please use this below guide to understand the whole process.
https://helpinhomework.org/blog/how-to-obtain-answer-through-google-drive-link