Running examples in ‘Lahman-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: HallOfFame
> ### Title: Hall of Fame Voting Data
> ### Aliases: HallOfFame
> ### Keywords: datasets
> 
> ### ** Examples
> 
> ## Some examples for  Hall of Fame induction data
> 
> require("dplyr")
Loading required package: dplyr

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> require("ggplot2")
Loading required package: ggplot2
> 
> ############################################################
> ## Some simple queries
> 
> # What are the different types of HOF voters?
> table(HallOfFame$votedBy)

           BBWAA       Centennial     Final Ballot     Negro League 
            3756                6               21               26 
 Nominating Vote       Old Timers          Run Off Special Election 
              76               30               81                2 
        Veterans 
             193 
> 
> # What was the first year of Hall of Fame elections?
> sort(unique(HallOfFame$yearID))[1]
[1] 1936
> # Who comprised the original class?
> subset(HallOfFame, yearID == 1936 & inducted == "Y")
   playerID yearID votedBy ballots needed votes inducted category needed_note
1  cobbty01   1936   BBWAA     226    170   222        Y   Player        <NA>
2  ruthba01   1936   BBWAA     226    170   215        Y   Player        <NA>
3 wagneho01   1936   BBWAA     226    170   215        Y   Player        <NA>
4 mathech01   1936   BBWAA     226    170   205        Y   Player        <NA>
5 johnswa01   1936   BBWAA     226    170   189        Y   Player        <NA>
> 
> # Result of a player's last year on the BBWAA ballot
> # Restrict to players voted by BBWAA:
> HOFplayers <- subset(HallOfFame, 
+                  votedBy == "BBWAA" & category == "Player")
> 
> 
> # Number of years as HOF candidate, last pct vote, etc.
> # for a given player
> playerOutcomes <- HallOfFame %>%
+     filter(votedBy == "BBWAA" & category == "Player") %>%
+     group_by(playerID) %>%
+     mutate(nyears = length(ballots)) %>%
+     arrange(yearID) %>%
+     do(tail(., 1)) %>%
+     mutate(lastPct = 100 * round(votes/ballots, 3)) %>%
+     select(playerID, nyears, inducted, lastPct, yearID) %>%
+     rename(lastYear = yearID)
> 
> 
> ############################################################
> # How many voting years until election?
> inducted <- subset(playerOutcomes, inducted == "Y")
> table(inducted$nyears)

 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 
53 11 10  8  8  4  3  4  6  4  3  1  4  1  2 
> 
> # Bar chart of years to induction for inductees
> barplot(table(inducted$nyears), 
+         main="Number of voting years until election",
+ 	    	ylab="Number of players", xlab="Years")
> box()
> 
> # What is the form of this distribution?
> require("vcd")
Loading required package: vcd
Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘vcd’
> goodfit(inducted$nyears)
Error in goodfit(inducted$nyears) : could not find function "goodfit"
Execution halted