Code Monkey home page Code Monkey logo

Comments (4)

yihui avatar yihui commented on May 29, 2024 1

It looks like an encoding problem. The good news is that R 4.2.0 is coming soon, which should solve most encoding problems on Windows. For now, you can try the alpha version: https://cran.r-project.org/bin/windows/base/rtest.html

from bookdown-demo.

yihui avatar yihui commented on May 29, 2024

I can't reproduce this problem. Could you run bookdown::render_book() in the R console? If it throws the same error, please provide traceback() output.

from bookdown-demo.

richardgao1992 avatar richardgao1992 commented on May 29, 2024

bookdown::render_book()
Rendering book in directory '.'

processing file: bookdown-demo.Rmd
|.......... | 11%
inline R code fragments

|................... | 22%
label: unnamed-chunk-1 (with options)
List of 1
$ eval: logi FALSE

|............................. | 33%
ordinary text without R code

|...................................... | 44%
label: unnamed-chunk-2 (with options)
List of 1
$ include: logi FALSE

Quitting from lines 32-36 (bookdown-demo.Rmd)
Error in parse(con) : 4:12: unexpected INCOMPLETE_STRING
3: title = "Welcome to the {tidyverse}",
4: author = "Hadley Wickham, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D'Agostino McGowan, Romain Fran
^

traceback()
31: parse(con)
30: tools:::.parse_CITATION_file(file, meta$Encoding)
29: readCitationFile(citfile, meta)
28: utils::citation(..., lib.loc = lib.loc)
27: citation(pkg, auto = FALSE)
26: FUN(X[[i]], ...)
25: lapply(x, function(pkg) {
if (pkg == "base")
return()
if (system.file("CITATION", package = pkg) == "")
return()
cites = citation(pkg, auto = FALSE)
cites = Filter(x = cites, function(cite) {
!isTRUE(grepl("R package version", cite$note))
})
s = make_unique(unlist(lapply(cites, function(cite) {
if (is.null(cite$year))
format(Sys.Date(), "%Y")
else cite$year
})))
mapply(cites, s, FUN = function(cite, suffix) {
if (isTRUE(grepl("R package version", cite$note)))
return()
entry = toBibtex(cite)
entry[1] = sub("\{,$", sprintf("{%s%s,", pkg, suffix),
entry[1])
...
24: knitr::write_bib(c(.packages(), "bookdown", "knitr", "rmarkdown"),
"packages.bib")
23: eval(expr, envir, enclos)
22: eval(expr, envir, enclos)
21: eval_with_user_handlers(expr, envir, enclos, user_handlers)
20: withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers))
19: withCallingHandlers(withVisible(eval_with_user_handlers(expr,
envir, enclos, user_handlers)), warning = wHandler, error = eHandler,
message = mHandler)
18: handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr,
envir, enclos, user_handlers)), warning = wHandler, error = eHandler,
message = mHandler))
17: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr,
envir, enclos, user_handlers)), warning = wHandler, error = eHandler,
message = mHandler)))
16: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
debug = debug, last = i == length(out), use_try = stop_on_error !=
2L, keep_warning = keep_warning, keep_message = keep_message,
output_handler = output_handler, include_timing = include_timing)
15: evaluate::evaluate(...)
14: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else {
if (options$error && options$include)
0L
else 2L
}, output_handler = knit_handlers(options$render, options))
13: in_dir(input_dir(), expr)
12: in_input_dir(evaluate(code, envir = env, new_device = FALSE,
keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
stop_on_error = if (is.numeric(options$error)) options$error else {
if (options$error && options$include)
0L
else 2L
}, output_handler = knit_handlers(options$render, options)))
11: eng_r(options)
10: block_exec(params)
9: call_block(x)
8: process_group.block(group)
7: process_group(group)
6: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
error = function(e) {
setwd(wd)
cat(res, sep = "\n", file = output %n% "")
message("Quitting from lines ", paste(current_lines(i),
collapse = "-"), " (", knit_concord$get("infile"),
") ")
})
5: process_file(text, output)
4: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
3: rmarkdown::render(main, output_format, ..., clean = clean, envir = envir)
2: render_cur_session(files, main, config, output_format, clean,
envir, ...)
1: bookdown::render_book()

from bookdown-demo.

cderv avatar cderv commented on May 29, 2024

Seems also a encoding issue to me. R does not manage to process this lette ç in Romain François in this reference in the bib file.

@Article{tidyverse2019,
  title = {Welcome to the {tidyverse}},
  author = {Hadley Wickham and Mara Averick and Jennifer Bryan and Winston Chang and Lucy D'Agostino McGowan and Romain François and Garrett Grolemund and Alex Hayes and Lionel Henry and Jim Hester and Max Kuhn and Thomas Lin Pedersen and Evan Miller and Stephan Milton Bache and Kirill Müller and Jeroen Ooms and David Robinson and Dana Paige Seidel and Vitalie Spinu and Kohske Takahashi and Davis Vaughan and Claus Wilke and Kara Woo and Hiroaki Yutani},
  year = {2019},
  journal = {Journal of Open Source Software},
  volume = {4},
  number = {43},
  pages = {1686},
  doi = {10.21105/joss.01686},
}

As a workaround, you can remove the bib file creation here, especially if you don't use it.

bookdown-demo/index.Rmd

Lines 32 to 35 in 5331ffc

# automatically create a bib database for R packages
knitr::write_bib(c(
.packages(), 'bookdown', 'knitr', 'rmarkdown'
), 'packages.bib')

And otherwise, remove this citation (which is probably included due to one of the tidyverse package).

For a full fix, we need to know if R 4.2 fix the issue for you or not. Thanks !

from bookdown-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.