1
votes

When I push my package to travis the vignette checks fail. I'm aware I can skip it but it's bugging me.

I have identified at least one of the issues belongs to a specific call in my code.

The RMD chunk in question:

get_storm_data("fstadv", link = al.1998.charley %>% .$Link)

al.1998.charley:

al.1998.charley <- structure(list(Year = 1998, 
                                  Name = "TROPICAL STORM CHARLEY", 
                                  Basin = "AL", 
                                  Link = "http://www.nhc.noaa.gov/archive/1998/1998CHARLEYadv.html"), 
                             class = "data.frame", 
                             row.names = c(NA, -1L), 
                             .Names = c("Year", "Name", "Basin", "Link"))

The link parameter is a character string sent to the function get_storm_data which does some web scraping.

The following three values are identical:

a <- al.1998.charley %>% .$Link
b <- al.1998.charley %>% `[[`('Link')
c <- "http://www.nhc.noaa.gov/archive/1998/1998CHARLEYadv.html"

identical(a, b) [1] TRUE

identical(b, c) [1] TRUE

However, only the value c passed to the link parameter will pass travis.

The travis error:

Building with: R CMD build 
6.09s$ R CMD build  .
* checking for file ‘./DESCRIPTION’ ... OK
* preparing ‘Hurricanes’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
Quitting from lines 86-87 (getting-started.Rmd) 
Error: processing vignette 'getting-started.Rmd' failed with diagnostics:
is.character(url) is not TRUE
Execution halted

All of my previous attempts to resolve this can be found here, if necessary.

Edit

This vignette never caused issues before. Build 16 passed. Nothing was different in the vignette. I did git diff between that commit and HEAD to bring the branch to it's exact match (since original branch had since been deleted). Other than cosmetic differences in other files (spaces, newlines, etc.), it still failed.

This led me to believe it was an upgrade or change on travis' end. I read over the blog but saw no related changes between the last successful pass (Build 16) and current.

Final Edit

When I mentioned in the last edit the vignette had not changed since the last succesful build, I should have been more clear. That entire commit that passed in March would not pass today. I'm still not clear why.

I would like to point out for any newcomers: check the travis packages to make sure they match your system. R CMD build on my system passed with no issues. But some of my packages were outdated compared to travis'. Thanks to @jimhester (GitHub) for pointing that out.

Session Info

R version 3.4.0 (2017-04-21)

Platform: x86_64-pc-linux-gnu (64-bit)

locale: _LC_CTYPE=en_US.UTF-8_, _LC_NUMERIC=C_, _LC_TIME=en_US.UTF-8_, _LC_COLLATE=en_US.UTF-8_, _LC_MONETARY=en_US.UTF-8_, _LC_MESSAGES=en_US.UTF-8_, _LC_PAPER=en_US.UTF-8_, _LC_NAME=C_, _LC_ADDRESS=C_, _LC_TELEPHONE=C_, _LC_MEASUREMENT=en_US.UTF-8_ and _LC_IDENTIFICATION=C_

attached base packages: stats, graphics, grDevices, utils, datasets, methods and base

other attached packages: Hurricanes(v.0.1.0), dplyr(v.0.5.0), purrr(v.0.2.2), readr(v.1.0.0), tidyr(v.0.6.1), tibble(v.1.2), ggplot2(v.2.2.1), tidyverse(v.1.0.0) and magrittr(v.1.5)

loaded via a namespace (and not attached): Rcpp(v.0.12.7), digest(v.0.6.10), assertthat(v.0.1), R6(v.2.2.0), grid(v.3.4.0), plyr(v.1.8.4), DBI(v.0.5-1), gtable(v.0.2.0), scales(v.0.4.1), lazyeval(v.0.2.0), data.table(v.1.10.4), tools(v.3.4.0), pander(v.0.6.0), munsell(v.0.4.3), compiler(v.3.4.0) and colorspace(v.1.3-0)

1

1 Answers

1
votes

Link in al.1998.charley is stored as a factor on Travis (perhaps you have set the stringsAsFactors option to FALSE somewhere locally?). httr won't coerce a factor vector to character, hence you get an error. Try wrapping as.character() around al.1998.charley %>% .$Link.