* using log directory 'd:/RCompile/CRANincoming/R-devel/Lahman.Rcheck' * using R Under development (unstable) (2024-09-23 r87189 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 13.2.0 GNU Fortran (GCC) 13.2.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'Lahman/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'Lahman' version '12.0-0' * package encoding: UTF-8 * checking CRAN incoming feasibility ... NOTE Maintainer: 'Chris Dalzell ' Size of tarball: 6046830 bytes * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'Lahman' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking for future file timestamps ... OK * checking 'build' directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of 'data' directory ... OK * checking data for non-ASCII characters ... OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking installed files from 'inst/doc' ... OK * checking files in 'vignettes' ... OK * checking examples ... ERROR Running examples in 'Lahman-Ex.R' failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: Batting > ### Title: Batting table > ### Aliases: Batting > ### Keywords: datasets > > ### ** Examples > > data(Batting) > head(Batting) playerID yearID stint teamID lgID G AB R H X2B X3B HR RBI SB CS BB SO IBB 1 aardsda01 2004 1 SFN NL 11 0 0 0 0 0 0 0 0 0 0 0 0 2 aardsda01 2006 1 CHN NL 45 2 0 0 0 0 0 0 0 0 0 0 0 3 aardsda01 2007 1 CHA AL 25 0 0 0 0 0 0 0 0 0 0 0 0 4 aardsda01 2008 1 BOS AL 47 1 0 0 0 0 0 0 0 0 0 1 0 5 aardsda01 2009 1 SEA AL 73 0 0 0 0 0 0 0 0 0 0 0 0 6 aardsda01 2010 1 SEA AL 53 0 0 0 0 0 0 0 0 0 0 0 0 HBP SH SF GIDP 1 0 0 0 0 2 0 1 0 0 3 0 0 0 0 4 0 0 0 0 5 0 0 0 0 6 0 0 0 0 > 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 > > ## Prelude: Extract information from Salaries and People > ## to be merged with the batting data. > > # Subset of Salaries data > salaries <- Salaries %>% + select(playerID, yearID, teamID, salary) > > # Subset of People table (player metadata) > peopleInfo <- People %>% + select(playerID, birthYear, birthMonth, nameLast, + nameFirst, bats) > > # Left join salaries and peopleInfo to batting data, > # create an age variable and sort by playerID, yearID and stint > # Returns an ignorable warning. > batting <- battingStats() %>% + left_join(salaries, + by =c("playerID", "yearID", "teamID")) %>% + left_join(peopleInfo, by = "playerID") %>% + mutate(age = yearID - birthYear - + 1L *(birthMonth >= 10)) %>% + arrange(playerID, yearID, stint) > > ## Generate a ggplot similar to the NYT graph in the story about Ted > ## Williams and the last .400 MLB season > # http://www.nytimes.com/interactive/2011/09/18/sports/baseball/WILLIAMS-GRAPHIC.html > > # Restrict the pool of eligible players to the years after 1899 and > # players with a minimum of 450 plate appearances (this covers the > # strike year of 1994 when Tony Gwynn hit .394 before play was suspended > # for the season - in a normal year, the minimum number of plate appearances is 502) > > eligibleHitters <- batting %>% + filter(yearID >= 1900 & PA > 450) > > # Find the hitters with the highest BA in MLB each year (there are a > # few ties). Include all players with BA > .400, whether they > # won a batting title or not, and add an indicator variable for > # .400 average in a season. > > topHitters <- eligibleHitters %>% + group_by(yearID) %>% + filter(BA == max(BA)| BA >= .400) %>% + mutate(ba400 = BA >= 0.400) %>% + select(playerID, yearID, nameLast, + nameFirst, BA, ba400) > > # Sub-data frame for the .400 hitters plus the outliers after 1950 > # (averages above .380) - used to produce labels in the plot below > bignames <- topHitters %>% + filter(ba400 | (yearID > 1950 & BA > 0.380)) %>% + arrange(desc(BA)) > > # Variable to provide a vertical offset to certain > # labels in the ggplot below > bignames$yoffset <- c(0, 0, 0, 0, 0.002, 0, 0, 0, + 0.001, -0.001, 0, -0.002, 0, 0, + 0.002, 0, 0) > > # Produce the plot > > require("ggplot2") Loading required package: ggplot2 Error: package or namespace load failed for 'ggplot2' in readRDS(nsInfoFilePath): unknown input format > ggplot(topHitters, aes(x = yearID, y = BA)) + + geom_point(aes(colour = ba400), size = 2.5) + + geom_hline(yintercept = 0.400, size = 1, colour = "gray70") + + geom_text(data = bignames, aes(y = BA + yoffset, + label = nameLast), + size = 3, hjust = 1.2) + + scale_colour_manual(values = c("FALSE" = "black", "TRUE" = "red")) + + xlim(1899, 2015) + + xlab("Year") + + scale_y_continuous("Batting average", + limits = c(0.330, 0.430), + breaks = seq(0.34, 0.42, by = 0.02), + labels = c(".340", ".360", ".380", ".400", ".420")) + + geom_smooth() + + theme(legend.position = "none") Error in ggplot(topHitters, aes(x = yearID, y = BA)) : could not find function "ggplot" Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... ERROR Error(s) in re-building vignettes: --- re-building 'hits-by-type.Rmd' using rmarkdown Quitting from lines 84-96 [plot1] (hits-by-type.Rmd) Error: processing vignette 'hits-by-type.Rmd' failed with diagnostics: package or namespace load failed for 'ggplot2' in readRDS(nsInfoFilePath): unknown input format --- failed re-building 'hits-by-type.Rmd' --- re-building 'payroll.Rmd' using rmarkdown Quitting from lines 31-34 [load-packages] (payroll.Rmd) Error: processing vignette 'payroll.Rmd' failed with diagnostics: package or namespace load failed for 'ggplot2' in readRDS(nsInfoFilePath): unknown input format --- failed re-building 'payroll.Rmd' --- re-building 'run-scoring-trends.Rmd' using rmarkdown Quitting from lines 21-27 [Setup] (run-scoring-trends.Rmd) Error: processing vignette 'run-scoring-trends.Rmd' failed with diagnostics: package or namespace load failed for 'ggplot2' in readRDS(nsInfoFilePath): unknown input format --- failed re-building 'run-scoring-trends.Rmd' --- re-building 'strikeoutsandhr.Rmd' using rmarkdown Quitting from lines 29-33 [load-packages] (strikeoutsandhr.Rmd) Error: processing vignette 'strikeoutsandhr.Rmd' failed with diagnostics: package or namespace load failed for 'ggplot2' in readRDS(nsInfoFilePath): unknown input format --- failed re-building 'strikeoutsandhr.Rmd' --- re-building 'vignette-intro.Rmd' using rmarkdown --- finished re-building 'vignette-intro.Rmd' SUMMARY: processing the following files failed: 'hits-by-type.Rmd' 'payroll.Rmd' 'run-scoring-trends.Rmd' 'strikeoutsandhr.Rmd' Error: Vignette re-building failed. Execution halted * checking PDF version of manual ... [19s] OK * checking HTML version of manual ... OK * DONE Status: 2 ERRORs, 1 NOTE