Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sans_ext error #141

Closed
thatchermo opened this issue Jan 25, 2019 · 2 comments
Closed

sans_ext error #141

thatchermo opened this issue Jan 25, 2019 · 2 comments

Comments

@thatchermo
Copy link

Hi. In attempting to build the book, I ran into this error:
object 'sans_ext' not found
that occurred in common.R associated to the line that reads
"{", knitr:::sans_ext(x), "}",
(about line 92, I believe)

With the caveat that I know very little, it looks like it's trying to use a private function from the knitr package that would remove a file name extension, but that function doesn't seem to exist? I got a lot farther in building by loading the package xfun and using its version of sans_ext in common.R. Or maybe I totally misunderstand the situation...

@gonzalezben81
Copy link

gonzalezben81 commented Feb 21, 2019

@thatchermo the 'xfun package' fixed that issue for me. I then ran into a few issues with other libraries: USAboundaries and USAboundariesData needing to be installed. There were a few function errors in the toolbox.Rmd file and also in the scales.Rmd file. One was an as.numeric in the scales.Rmd file that involved the ggplot of mpg when converting the X axis to Liters. I simply dropped the conversion to Liters for the label. See below:

    ggplot(mpg, aes(displ, hwy)) + 
      geom_point() +  
      scale_x_continuous("Displacement") + 
      scale_y_continuous(quote(paste("Highway ", (frac(miles, gallon))))) 

Here is a list of all of the packages I needed to install:
Note: make sure you source all of these in the common.R file in the file directory.

library(ggplot2)
library(dplyr)
library(tidyr)
library(xfun)
library(scales)
library(Lahman)
library(broom)
library(mapproj)
library(wesanderson)
library(USAboundaries)
library(scales)
library(ggplot2)
library(ggplot2movies)
library(tidyr)
library(directlabels)
library(ggthemes)
library(Hmisc)
library(readr)
library(USAboundariesData)
library(ggmap)
library(raster)

If you are on Ubuntu you need to run the following for the book to make:

sudo apt-get install pandoc-citeproc

###You need the latest version of pandoc or the make will error out. 
sudo apt-get install pandoc

Overall, either commenting out the code that was not working or removing it allowed the book to be compiled. Hope this helps anyone else.

@hadley
Copy link
Owner

hadley commented Jun 15, 2019

Should be fixed by #142

@hadley hadley closed this as completed Jun 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants