I am a complete beginner in R. My data below was generated by @akrun and here is the code:
tennis4 <- structure(list(Tournament = "Win-Loss", `2005` = "3-2", `2006` = "6-4",
`2007` = "5-2", `2008` = "12-4", `2009` = "15-4", `2010` = "16-4",
`2011` = "21-4", `2012` = "22-3", `2013` = "17-2", `2014` = "17-4",
`2015` = "19-4", `2016` = "19-2", `W-L` = "172-39", `Win %` = 81.52),
.Names = c("Tournament",
"2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012",
"2013", "2014", "2015", "2016", "W-L", "Win %"), row.names = c(NA,
-1L), class = "data.frame")
I want to separate the values of "Win-Loss" into "Win" and "Loss". My aim is to separate the data ("3-2" to "3" and "2") and store them in their respective places, but I do not know how to make R breaks them apart. Can someone please enlighten me of any functions to separate them?
After separating them apart, which function can I use to plot 2 different variables on the same table for comparison?