I'm a beginner here so please excuse my naiveness.
It appears that the book contains out-dated files from the Lahman data base? The Lahman data base that I've downloaded contains only a 'HallOfFame.csv' file and no longer separate ones like the book insinuates - hofbatting.csv & hofpitching.csv?
In order to get around this I read in the data through:
hof <- read_csv("Documents/R Project/Baseball/Lahman/core/HallOfFame.csv")
But the next code in the sequence I can't seem to navigate around. The message I keep receiving is "Error: object 'From' not found" for this code:
hof$MidCareer <- with(hof, (From + To) / 2)
hof$Era <- cut(hof$MidCareer,
breaks = c(1800, 1900, 1919, 1941, 1960, 1976, 1993, 2050),
labels = c("19th Century", "Dead Ball", "Lively Ball", "Integration", "Expansion", "Free Agency", "Long Ball"))
I've tried to find answers online about the 'From + To' function of the code but cant seem to find anything relevant. There must be an easy solution to this but I'm a beginner so I'm unaware of any easy fixes. Any help to this problem would be much appreciated, Thanks.
I'm a beginner here so please excuse my naiveness.
It appears that the book contains out-dated files from the Lahman data base? The Lahman data base that I've downloaded contains only a 'HallOfFame.csv' file and no longer separate ones like the book insinuates - hofbatting.csv & hofpitching.csv?
In order to get around this I read in the data through: hof <- read_csv("Documents/R Project/Baseball/Lahman/core/HallOfFame.csv")
But the next code in the sequence I can't seem to navigate around. The message I keep receiving is "Error: object 'From' not found" for this code: hof$MidCareer <- with(hof, (From + To) / 2) hof$Era <- cut(hof$MidCareer, breaks = c(1800, 1900, 1919, 1941, 1960, 1976, 1993, 2050), labels = c("19th Century", "Dead Ball", "Lively Ball", "Integration", "Expansion", "Free Agency", "Long Ball"))
I've tried to find answers online about the 'From + To' function of the code but cant seem to find anything relevant. There must be an easy solution to this but I'm a beginner so I'm unaware of any easy fixes. Any help to this problem would be much appreciated, Thanks.