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

Mysterious error seemingly caused by \code{vignette()} in section 'Details'. #652

Closed
GeoBosh opened this Issue May 2, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@GeoBosh

GeoBosh commented May 2, 2018

A weird error appears when pkgdown::build_site() renders
https://github.com/GeoBosh/Rdpack/blob/master/man/makeVignetteReference.Rd.
I narrowed the error down to
instances of \code{vignette(package=package)} and \code{vignette()} in section 'Details'.
When I commented out the lines containing them, the error disappeared,

Reading 'man/makeVignetteReference.Rd'
Error in match(x, table, nomatch = 0L) :
  'match' requires vector arguments
In addition: There were 13 warnings (use warnings() to see them)

The match command is in package %in% c("utils", etc), where package seemed to be the symbol package. Initially I thought that all this may be somehow related to the fact that the function described in this file also has argument package.

The error was slightly different depending on which of the lines mentioned above was not commented out. I used a version of pkgdown installed from github today. Some details are below.

``` > pkgdown::build_site() Unknown tag: UNKNOWN/tag Unknown tag: UNKNOWN/tag Unknown tag: UNKNOWN/tag Unknown tag: UNKNOWN/tag Unknown tag: UNKNOWN/tag == Building pkgdown site ======================================================= Reading from: 'c:/Users/mcbssgb2/Az/Rdevel/Rdpack' Writing to: 'c:/Users/mcbssgb2/Az/Rdevel/Rdpack/docs' -- Initialising site ----------------------------------------------------------- -- Building home --------------------------------------------------------------- Writing 'index.html' -- Building function reference ------------------------------------------------- Writing 'reference/index.html' Loading Rdpack Reading 'man/append_to_Rd_list.Rd' Reading 'man/bibentry_key.Rd' Reading 'man/char2Rdpiece.Rd' Reading 'man/compare_usage1.Rd' Reading 'man/c_Rd.Rd' Reading 'man/deparse_usage.Rd' Reading 'man/ereprompt.Rd' Reading 'man/format_funusage.Rd' Reading 'man/get_bibentries.Rd' Reading 'man/get_sig_text.Rd' Reading 'man/get_usage_text.Rd' Reading 'man/insert_all_ref.Rd' Reading 'man/insert_ref.Rd' Reading 'man/inspect_args.Rd' Reading 'man/inspect_Rd.Rd' Reading 'man/inspect_signatures.Rd' Reading 'man/inspect_slots.Rd' Reading 'man/inspect_usage.Rd' Reading 'man/list_Rd.Rd' Writing 'reference/list_Rd.html' Reading 'man/makeVignetteReference.Rd' Reading 'man/parse_pairlist.Rd' Reading 'man/parse_Rdname.Rd' Reading 'man/parse_Rdpiece.Rd' Reading 'man/parse_Rdtext.Rd' Reading 'man/parse_text.Rd' Reading 'man/parse_usage_text.Rd' Reading 'man/predefined.Rd' Reading 'man/promptPackageSexpr.Rd' Reading 'man/promptUsage.Rd' Reading 'man/Rdapply.Rd' Writing 'reference/Rdapply.html' Reading 'man/Rdo2Rdf.Rd' Reading 'man/Rdo_append_argument.Rd' Reading 'man/Rdo_collect_metadata.Rd' Reading 'man/Rdo_empty_sections.Rd' Reading 'man/Rdo_flatinsert.Rd' Reading 'man/Rdo_get_argument_names.Rd' Reading 'man/Rdo_get_insert_pos.Rd' Reading 'man/Rdo_get_item_labels.Rd' Reading 'man/Rdo_insert.Rd' Reading 'man/Rdo_insert_element.Rd' Reading 'man/Rdo_is_newline.Rd' Reading 'man/Rdo_locate.Rd' Reading 'man/Rdo_locate_leaves.Rd' Writing 'reference/Rdo_locate_leaves.html' Reading 'man/Rdo_macro.Rd' Reading 'man/Rdo_modify.Rd' Reading 'man/Rdo_modify_simple.Rd' Reading 'man/Rdo_piecetag.Rd' Reading 'man/Rdo_reparse.Rd' Reading 'man/Rdo_sections.Rd' Reading 'man/Rdo_set_section.Rd' Writing 'reference/Rdo_set_section.html' Reading 'man/Rdo_show.Rd' Reading 'man/Rdo_tag.Rd' Reading 'man/Rdo_tags.Rd' Reading 'man/rdo_text_restore.Rd' Reading 'man/Rdo_which.Rd' Reading 'man/Rdpack-package.Rd' Unknown tag: UNKNOWN/tag Unknown tag: UNKNOWN/tag Unknown tag: UNKNOWN/tag Unknown tag: UNKNOWN/tag Unknown tag: UNKNOWN/tag Reading 'man/Rdreplace_section.Rd' Reading 'man/Rd_combo.Rd' Reading 'man/Rd_remove_srcref.Rd' Reading 'man/rebib.Rd' Reading 'man/reprompt.Rd' Reading 'man/RStudio_reprompt.Rd' Reading 'man/S4formals.Rd' Reading 'man/update_aliases_tmp.Rd' Reading 'man/viewRd.Rd' Reading 'man/zzasym_compare.Rd' Reading 'man/zzbsdup.Rd' Reading 'man/zzcapture_promptany.Rd' -- Building news --------------------------------------------------------------- -- Previewing site ------------------------------------------------------------- == DONE ======================================================================== Warning messages: 1: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\Users' 2: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\mcbssgb' 3: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\Az' 4: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\Rdevel' 5: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\Rdpack' 6: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\Users' 7: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\mcbssgb' 8: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\Az' 9: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\Rdevel' 10: In tools::parse_Rd(con, fragment = fragment, encoding = "UTF-8") : :2: unknown macro '\Rdpack' > sessionInfo() R version 3.4.4 Patched (2018-03-19 r74453) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods
[8] base

other attached packages:
[1] Rdpack_0.7-1

loaded via a namespace (and not attached):
[1] Rcpp_0.12.16 pillar_1.2.1 compiler_3.4.4 plyr_1.8.4
[5] bindr_0.1.1 tools_3.4.4 highlight_0.4.7.2 digest_0.6.15
[9] evaluate_0.10.1 jsonlite_1.5 memoise_1.1.0 tibble_1.4.2
[13] rcrossref_0.8.0 pkgconfig_2.0.1 rlang_0.2.0 bibtex_0.4.2
[17] cli_1.0.0 rstudioapi_0.7 shiny_1.0.5 commonmark_1.4
[21] curl_3.1 yaml_2.1.18 pkgdown_1.0.0 bindrcpp_0.2
[25] withr_2.1.2 knitr_1.20 httr_1.3.1 dplyr_0.7.4
[29] stringr_1.3.0 biblib_1.0 xml2_1.2.0 roxygen2_6.0.1
[33] devtools_1.13.5 desc_1.1.1 fs_1.2.2 gbRd_0.4-12
[37] rprojroot_1.3-2 glue_1.2.0 R6_2.2.2 rematch_1.0.1
[41] rmarkdown_1.9 whisker_0.3-2 purrr_0.2.4 magrittr_1.5
[45] backports_1.1.2 htmltools_0.3.6 MASS_7.3-49 assertthat_0.2.0
[49] mime_0.5 xtable_1.8-2 httpuv_1.3.6.2 stringi_1.1.7
[53] miniUI_0.1.1 crayon_1.3.4

</details>
@batpigandme

This comment has been minimized.

Member

batpigandme commented May 3, 2018

Is pkgdown rendering other pages in which you have internally-defined macros?
I could be wrong here, but I think for articles (from vignettes) build_articles() takes Rmd as input, so I'm not sure that the Rnw vignette will work… (though I realise that's not what you're building in this specific issue)

@batpigandme batpigandme changed the title from Misterous error seemingly caused by \code{vignette()} in section 'Details'. to Mysterious error seemingly caused by \code{vignette()} in section 'Details'. May 3, 2018

@GeoBosh

This comment has been minimized.

GeoBosh commented May 3, 2018

I don't think that makeVignetteReference.Rd contains any user defined macros (\code{} is part of Rd).
But to answer your question, there are user macros for citations and references in insert_ref.Rd and Rdpack-package, for example, and they are processed OK. Note also that there are numerous uses of \code, including in the offending page, which do not cause trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment