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

Table translation fails if no trailing \cr #664

Closed
mcneney opened this issue May 13, 2018 · 6 comments
Closed

Table translation fails if no trailing \cr #664

mcneney opened this issue May 13, 2018 · 6 comments

Comments

@mcneney
Copy link

@mcneney mcneney commented May 13, 2018

I'm trying to use pkgdown to build a website for the package LDheatmap. build_reference() processes two of the help files successfully, then stops while processing the third with the following error:

Reading 'man/GIMAP5.Rd' Error in seq_len(last) : argument must be coercible to non-negative integer

(Not sure how to extract a smaller reproducible example to illustrate the problem.)

Any suggestions?

@batpigandme
Copy link
Member

@batpigandme batpigandme commented May 13, 2018

Can you please link to the problem file/section in the original R code as well as the Rd file?

Thanks

@mcneney
Copy link
Author

@mcneney mcneney commented May 13, 2018

The problem file is the Rd file
https://github.com/mcneney/LDheatmap/blob/master/man/LDheatmap.Rd. I don't know what you mean by "section in the original R code". If you are asking which example in the Rd file is the problem, I don't know. I find it very hard to follow the traceback() or debug build_reference(). I've clipped in the traceback below.

`Reading 'man/GIMAP5.Rd'
Error in seq_len(last) :
argument must be coercible to non-negative integer

traceback()
26: NextMethod()
25: structure(NextMethod(), class = class(x))
24: [.tag(contents, seq_len(last))
23: contents[seq_len(last)]
22: as_html.tag_tabular(.x[[i]], ...)
21: .f(.x[[i]], ...)
20: .Call(map_impl, environment(), ".x", ".f", "character")
19: purrr::map_chr(x, as_html, ...)
18: flatten_para(x, ...)
17: parse_section(x, "Format", ...)
16: as_data.tag_format(.x[[i]], ...)
15: .f(.x[[i]], ...)
14: .Call(map_impl, environment(), ".x", ".f", "list")
13: purrr::map(., as_data)
12: function_list[i]
11: freduce(value, _function_list)
10: _fseq(_lhs)
9: eval(quote(_fseq(_lhs)), env, env)
8: eval(quote(_fseq(_lhs)), env, env)
7: withVisible(eval(quote(_fseq(_lhs)), env, env))
6: sections %>% purrr::map(as_data) %>% purrr::map(add_slug)
5: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run,
mathjax = mathjax)
4: .f(.x[[i]], ...)
3: .Call(map_impl, environment(), ".x", ".f", "list")
2: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy,
examples = examples, run_dont_run = run_dont_run, mathjax = mathjax)
1: build_reference()`

@mcneney
Copy link
Author

@mcneney mcneney commented May 15, 2018

A summer student working with me figured it out: I had several \tabular environments in my .Rd files where the last row did not end in a \cr (like I always do in LaTeX). When she puts \cr's at the end of all lines pkgdown runs fine. Is this behaviour expected?
Brad

@hadley
Copy link
Member

@hadley hadley commented May 15, 2018

It's clearly a bug; at a minimum you should get a better error message.

@hadley hadley changed the title Error from build_reference() on package LDheatmap Table translation fails if no trailing \cr May 22, 2018
@hadley hadley changed the title Table translation fails if no trailing \cr Table translation fails if no trailing \cr May 22, 2018
@hadley
Copy link
Member

@hadley hadley commented May 22, 2018

@hadley hadley closed this in 1075ee6 May 22, 2018
@mcneney
Copy link
Author

@mcneney mcneney commented May 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants