Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: yihui/knitr

knitr 1.50

16 Mar 20:31

Choose a tag to compare

NEW FEATURES

  • For inline code expressions, their specific line numbers will be shown in the message when errors occur (thanks,@kevinushey,#2387). Previously, the numbers were not specific to the inline code but the lines of the whole text chunk containing the inline code, which are often quite vague.

  • Display error traceback when vignettes fail inR CMD build (thanks,@hadley,#2390).

  • kable() properly supports column alignment for Org Mode tables now (thanks,@mclements,#2391).

MINOR CHANGES

  • Moved implementations ofcombine_words() andwrite_bib() to thexfun package asxfun::join_words() andxfun::pkg_bib(), respectively, since they are not directly relevant toknitr. The functionscombine_words() andwrite_bib() are still kept inknitr, and can continue to be used in the future.

  • A warning will be issued when chunk options are duplicated in both the chunk header and pipe comments (thanks,@cderv,#2386). A chunk option should appear in only one of these places.

  • Removed the functionread_rforge() since it has stopped working for a long time.

  • Removed demos from the package (which were early experiments from several years ago).

Contributors

  • @hadley
  • @mclements
  • @kevinushey
  • @cderv
hadley, mclements, and 2 other contributors
Assets2
Loading
einGlasRotwein reacted with heart emoji
1 person reacted

knitr 1.49

08 Nov 14:03

Choose a tag to compare

NEW FEATURES

  • In-chunk references of the form<<label>> can be disabled via the chunk optionref.chunk = FALSE now (thanks,@jennybc@gadenbuie,#2360).

  • Added support forfig.alt for LaTeX output, i.e., using\includegraphics[alt={alt text}] (thanks,@capnrefsmmat,#2378).

  • The environment in which code chunks are evaluated can be changed by passing a custom environment toknit_global() now (thanks,@abhsarma,#2358).

BUG FIXES

  • In-chunk references of the form<<label>> should not be resolved iflabel is not found in the document (thanks,@jennybc@gadenbuie,#2360).

  • The chunk optionautodep = TRUE stopped working due to a regression from#2321 (thanks,@heavywatal#2344,@atusy#2377).

  • asis_output() was not passed to theoutput hook (thanks,@cderv,#2332).

  • Avoid partial matching of theDate/Publication field when generatingcitation('knitr'), otherwise R will emit a warning whenoptions(warnPartialMatchDollar = TRUE) (thanks,@fkohrt,#2361).

MAJOR CHANGES

  • Unbalanced chunk delimiters (fences) in R Markdown documents are strictly prohibited now.

  • For code chunks witherror = TRUE,purl() andhook_purl() will wrap the code intry({...}) (thanks,@bastistician#2338,@jeroen#2368).

MINOR CHANGES

  • If a character value is passed to the chunk optionmessage orwarning, it will be coerced byas.logical(), e.g., a character string"NA" will be coerced toNA (thanks,@cderv,#2375).

  • Issue a warning when the chunk optiondependson receives an invalid value (thanks,@otoomet,#2376).

  • Changed the format of the reference card from PDF to HTML so building this package will not require LaTeX. Seevignette('knitr-refcard', package = 'knitr').

  • Switched the vignette engine fromknitr tolitedown::vignette for some package vignettes.

Contributors

  • @jeroen
  • @jennybc
  • @capnrefsmmat
  • @heavywatal
  • @bastistician
  • @gadenbuie
  • @cderv
  • @fkohrt
  • @otoomet
  • @abhsarma
  • @atusy
jeroen, jennybc, and 9 other contributors
Loading

knitr 1.48

08 Jul 15:06

Choose a tag to compare

BUG FIXES

  • Fix regression from 1.46 withcollapse = TRUE option not correctly collapsing source code and output into one when code chunk returns multiple outputs (thanks,@jennybc,@florisvdh,tidyverse/reprex#463).

  • hook_purl() should not write the path of the R script to the output document (thanks,@fenguoerbian,#2348).

Contributors

  • @jennybc
  • @fenguoerbian
  • @florisvdh
jennybc, fenguoerbian, and florisvdh
Loading

knitr 1.47

29 May 07:38

Choose a tag to compare

NEW FEATURES

  • Forkable(), you can set the global optionknitr.kable.max_rows to limit the number of rows to show in the table, e.g.,options(knitr.kable.max_rows = 30). This is a way to preventkable() from generating a huge table from a large data object by accident.

  • write_bib() now escapes all non-escaped "&" in the bibliography by default. Previously, it only escaped the title field of the package citation. You can disable the escape with the argumenttweak = FALSE (thanks,@HedvigS#2335,@atusy#2342).

BUG FIXES

  • Fixed a bug thatwrite_bib() fails to use the first URL of a package when multiple URLs are provided in DESCRIPTION and separated by\n (thanks,@bastistician,#2343).

MINOR CHANGES

  • The syntax highlighting LaTeX commands for Rnw documents,\hlstr and\hlstd, were renamed to\hlsng and\hldef, respectively, to maintain consistency with Andrew Simon's highlight package (thanks,@dcser123,#2341).

Contributors

  • @bastistician
  • @HedvigS
  • @atusy
  • @dcser123
bastistician, HedvigS, and 2 other contributors
Loading
eitsupi, martin-spa, and seb-mueller reacted with hooray emoji
3 people reacted

knitr 1.46

06 Apr 23:07

Choose a tag to compare

NEW FEATURES

  • Added a new chunk optiontab.cap to specify the table caption forkable() (thanks,@ulyngs,#1679). Previously, the caption could only be specified via thecaption argument ofkable(). Now you can set it in the chunk header if you want. Please note that this chunk option only works with a singlekable() in each code chunk, and its value must be of length 1.

  • spin() now recognizes# %% as a valid code chunk delimiter (thanks,@kylebutts,#2307).

  • spin() also recognizes#| comments as code chunks now (thanks,@kylebutts,#2320).

  • Chunk hooks can have the... argument now. Previously, only argumentsbefore,options,envir, andname are accepted. If a chunk hook function has the... argument, all the aforementioned four arguments are passed to the hook. This means the hook function no longer has to have the four arguments explicitly in its signature, e.g.,function(before, ...) is also valid if only thebefore argument is used inside the hook. Seehttps://yihui.org/knitr/hooks/#chunk-hooks for more information.

  • For package vignettes, PNG plots will be optimized byoptipng andpngquant if they are installed and can be found from the systemPATH variable. This can help reduce the package size if vignettes contain PNG plots (thanks,@nanxstats,https://nanx.me/blog/post/rpkgs-pngquant-ragg/).

BUG FIXES

  • spin() stopped working with input that cannot be parsed as R code due to#1605. Now it works again (thanks,@Hemken,#1773).

  • write_bib() generated empty entries for packages without URLs (thanks,@bastistician,#2304).

  • Thefamily argument was not passed to thepdf device (thanks,@sebkopf,rstudio/rmarkdown#2526).

  • Trailing spaces escaped by\ should not be trimmed inkable() (thanks,@mjsmith037,#2308).

  • kable() fails when the value of thecaption argument is of length > 1 (thanks,@LeeMendelowitz,#2312).

  • include_graphics() may provide an incorrect plot width to LaTeX when the locale setting forLC_NUMERIC is notC because the decimal separator may not be a dot (thanks,@tdhock,rstudio/rmarkdown#2525).

  • When TinyTeX and the LaTeX packagepdfcrop are installed,knitr::pdf_crop() is unable to findpdfcrop (thanks,@dmkaplan2000,rstudio/tinytex#435).

MAJOR CHANGES

  • Unbalanced chunk delimiters (fences) in R Markdown documents are no longer allowed, as announced two years ago athttps://yihui.org/en/2021/10/unbalanced-delimiters/ (#2306). This means the opening delimiter must strictly match the closing delimiter, e.g., if a code chunk starts with four backticks, it must also end with four; or if a chunk header is indented by two spaces, the closing fence must be indented by exactly two spaces. For authors who cannot update their R Markdown documents for any reason at the moment, settingoptions(knitr.unbalanced.chunk = TRUE) (e.g., in.Rprofile) can temporarily preventknitr from throwing an error, but it is strongly recommended that you fix the problems as soon as possible, because this workaround will be removed in future.

  • Package vignettes are tangled by default duringR CMD check, per request from CRAN maintainers (d0d1b47). The consequence is thatR CMD check will check R scripts tangled from vignettes by default, unless you set the environment variable_R_CHECK_VIGNETTES_SKIP_RUN_MAYBE_=true. Previously,knitr would skip tangling vignettes duringR CMD check, because R scripts tangled from vignettes are not guaranteed to valid. With the skip undone,R CMD check may fail in places other than CRAN (because CRAN has set the environment variable).

MINOR CHANGES

  • Fixed broken vignettes, improved CSS for HTML vignettes, and reduced the file sizes.

  • SQL code chunks that runALTER statements are only executed and not tried to fecth a result (thanks,@maxschmi,#2330).

  • The functionimgur_upload() has been moved to (and enhanced in) thexfun package asxfun::upload_imgur() so it is no longer tied toknitr and can be reused by other pakages. Nowknitr::imgur_upload() is only a wrapper function ofxfun::upload_imgur(). You are recommended to use the latter (#2325).

  • spin() dropped support for#- as the chunk delimiter token. Please use#+ or# %% or#| instead.

  • Faster processing of cache dependencies indep_auto() (thanks,@knokknok,#2318).

  • Removed some S3 methods that are used internally and changed them to normal functions:print.block -> print_block,print.inline -> print_inline,process_group.block/process_group.inline -> process_group, andprocess_tangle.block/process_tangle.inline -> process_tangle.

Contributors

  • @nanxstats
  • @dmkaplan2000
  • @tdhock
  • @knokknok
  • @LeeMendelowitz
  • @mjsmith037
  • @bastistician
  • @sebkopf
  • @Hemken
  • @kylebutts
  • @ulyngs
  • @maxschmi
nanxstats, dmkaplan2000, and 10 other contributors
Loading
eitsupi reacted with hooray emoji
1 person reacted

knitr 1.45

30 Oct 14:44

Choose a tag to compare

NEW FEATURES

  • Improved the error message to contain more specific information when YAML chunk options could not be parsed (thanks,@pedropark99,#2294).

BUG FIXES

  • Special characters in the chunk optionfig.alt are properly escaped now (thanks,@jay-sf,#2290).

  • Negative numbers returned from inline R expressions lost their minus signs when formatted in the scientific notation (thanks,@fkohrt,#2288).

  • convert_chunk_header(type = 'yaml') will now use dash option name for known knitr options, and numeric option are kept with same significant digits, e.gfig.width = 10 is converted tofig-width: 10.

  • Add the necessary\newline to the last subfigure (thanks,@slrellison,rstudio/rmarkdown#2518).

  • Percent signs (%) in LaTeX figure captions and short captions are properly escaped now (thanks,@s-u,#2302).

MAJOR CHANGES

  • The objectopts_current will be restored after each code chunk has finished executing. Previously, it would not be restored, which means even for inline R expressions,opts_current$get() will inherit chunk options from a previous code chunk (thanks,@rundel,#1988). Besides,opts_current$get('label') will return a unique label for inline expressions. One possible application is to construct unique figure paths viafig_path() (e.g.,ropensci/magick#310).

  • opts_current$set() withoutopts_current$lock(FALSE) will trigger a warning instead of an error for now and it will become an error in future (#2296).

Contributors

  • @rundel
  • @s-u
  • @fkohrt
  • @jay-sf
  • @slrellison
  • @pedropark99
rundel, s-u, and 4 other contributors
Loading
eitsupi reacted with hooray emoji
1 person reacted

knitr 1.44

11 Sep 17:40

Choose a tag to compare

NEW FEATURES

  • kable() can generate Emacs org-mode tables now viakable(..., format = 'org') (thanks,@xvrdm#1372,@maxecharel#2258).

  • Added support for theqmd (Quarto) output format tospin(), e.g.,spin('script.R', format = 'qmd') (thanks,@cderv,#2284).

  • write_bib() has a new argumentpackageURL to control whether to use a URL from theDESCRIPTION file or the one generated byutils::citation() (thanks,@dmurdoch,#2264).

  • Updated the package vignettevignette('knit_print', 'knitr') to mention that package authors no longer have to makeknitr a hard dependency if they want to define S3 methods forknitr::knit_print with R >= 3.6.0 (thanks,@cderv,#1929).

  • Added a new functiondownload_image() to download an image from a URL and include it viainclude_graphics(). This is mainly for including online images when the output format is not HTML (e.g., LaTeX), because the URL will not work as the image path, and it has to be downloaded beforehand (thanks,@bayeslearner,#2274).

BUG FIXES

  • Make the internal functionadd_html_caption() work with Quarto <= v1.3.353 (thanks,@giabaio,#2261).

  • Fixed a bug inspin(format = 'Rnw') reported by@Tarious14 atyihui/yihui.org#769 (reply in thread)

  • When the chunk optiondev = 'svglite', thesvglite device should be used to record plots (thanks,@Darxor,#2272).

  • Figure captions are no longer escaped for reStructuredText output, and the alt text can also be specified via thefig.alt chunk option now (thanks,@trevorld,#2023).

  • Use the correct type of progress bar when rendering Quarto documents in RStudio, which takes place in RStudio's background jobs pane or build pane (thanks,@hadley,#2271).

  • Theopts_current object can no longer be modified within code chunks via its$set() method (thanks,@AshesITR,#1798).

  • The argumentcol.names ofkable() can be used to specify the column name of row names now, e.g.,kable(head(mtcars), col.names = c("car", names(mtcars))) ("car" will be the column name of row names in the first column) (thanks, @iago-pssjd,#1933).

MAJOR CHANGES

  • Dashes (-) in the names of all chunk options are normalized to dots (.) now, e.g.,fig-height will be converted tofig.height. This is to makeknitr more compatible with Quarto since Quarto always use dashes in chunk option names (#2282).

MINOR CHANGES

  • In-body chunk options (#|) are now preserved when extracting code from a document viapurl() (thanks,@LuisLauM,#2268).

  • A warning message will be issued when taking PDF screenshots for HTML widgets with thewebshot2 package, becausewebshot2 doesn't use the correct figure size at the moment (thanks,@icejean,#2276).

  • If thetitle argument ofknit2wp() is omitted and atitle field is specified in the YAML metadata of the input document, the YAMLtitle will be used (thanks,@arencambre,#1924).

Contributors

  • @hadley
  • @arencambre
  • @Darxor
  • @dmurdoch
  • @AshesITR
  • @trevorld
  • @xvrdm
  • @cderv
  • @LuisLauM
  • @giabaio
  • @iagogv3
  • @icejean
  • @maxecharel
  • @bayeslearnerold
  • @Tarious14
hadley, arencambre, and 13 other contributors
Loading
eitsupi, Shitao5, olivroy, and shikokuchuo reacted with hooray emoji
4 people reacted

knitr 1.43

25 May 13:30

Choose a tag to compare

NEW FEATURES

  • Progress bar includes the chunk location (chunk-name @ file:line) whenoptions(knitr.progress.linenums = TRUE) is set (thanks,@zeehio,#2232).

  • The global optionknitr.progress.simple can be used to decide whether to output the bar in the progress. When set toFALSE, only the step numbers and chunk labels will be printed, and the progress bar is omitted. This can be more useful for logging purposes since the bar itself is not useful (thanks,@hadley,#2221). By default, the simple progress output is used when the progress is not written to a connection such asstdout orstderr (e.g., written to a file instead), or the output connection is not a "terminal".

  • HTML Widgets can now support alt text by specifying an attributearia-labelledby="<label>" in their first HTML tag. The text will be obtained from thefig.alt orfig.cap chunk option in the usual way (thanks,@dmurdoch,#2243).

  • Added a new argumentnewline tokable() to handle newlines in data when the table output format is Markdown-based (simple,pipe,rst, orjira). By default, newlines are not processed, which can result in broken tables. To substitute newlines with spaces, usekable(..., newline = ' '). To remove newlines, usekable(..., newline = '') (thanks,@aronatkins,#2255).

BUG FIXES

  • The chunk optioncollapse = TRUE works with HTML widgets now (thanks,@dmurdoch,#2212).

  • Option hooks should be run before child documents are processed (thanks,@richarddmorey,#2247).

  • For.Rnw documents,is_latex_output() returnsTRUE for output formatssweave (render_sweave()) andlistings (render_listings()) now (thanks,@DavisVaughan,#2231).

  • write_bib() does not fail anymore if an empty string is passed as package name (thanks,@phargarten2,#2240).

  • Fix an issue with usingcache = TRUE onsql engine chunk not defining aoutput.var (thanks,@mfherman,@eitsupi,#1842).

  • plot_crop() correctly checks the required tools (pdfcrop andghostscript) on Windows when the LaTeX is distribution is TeX Live or TinyTeX (thanks,@remlapmot,#2246). An external installation ofghostscript is no longer required on Windows, since TeX Live's built-inghostscript will be used.

  • The chunk optiondev.args was not recognized in certain cases (thanks,@petrbouchal,#2238).

MINOR CHANGES

  • Thecss andjs engines work for themarkdown output format now. Previous these engines will not output anything when the output format ismarkdown. If you still want to disable them formarkdown output, you may use the chunk optioneval = FALSE oreval = knitr::is_html_output(excludes = 'markdown').

  • is_html_output() recognizes R Markdown v1 documents now (.Rmd documents compiled via themarkdown package).

  • For.Rnw documents, dots in figure file paths are no longer sanitized to underscores (thanks,@otoomet,#2213). Other special characters are still sanitized, but this feature can be turned off viaoptions(knitr.sanitize.paths = FALSE).

  • imgur_upload() now recognizes a global optionknitr.imgur.key or an environment variableR_KNITR_IMGUR_KEY for a custom client ID (thanks,@jonthegeek,#2233).

  • imgur_upload() requires fewer package dependencies now. It only requires thecurl package;httr is no longer required, andxml2 has become optional.

Contributors

  • @hadley
  • @zeehio
  • @aronatkins
  • @richarddmorey
  • @petrbouchal
  • @dmurdoch
  • @remlapmot
  • @otoomet
  • @phargarten2
  • @DavisVaughan
  • @mfherman
  • @jonthegeek
  • @eitsupi
hadley, zeehio, and 11 other contributors
Loading
SchmidtPaul, exkuretrol, and anbrav0 reacted with thumbs up emojieitsupi, AjayKMehta, and gongcastro reacted with hooray emoji
6 people reacted

knitr 1.42

25 Jan 14:27

Choose a tag to compare

NEW FEATURES

  • Better.qmd (Quarto) file support:

    • purl() will keep the in-chunk YAML syntax for options in the tangled R file
    • knit() will produce a.md file instead of.txt
  • Users can specify a custom progress bar forknit() now. The default is still a text progress bar created fromutils::txtProgressBar(). To specify a custom progress bar, setoptions(knitr.progress.fun = function(total, labels) {}). This function should take argumentstotal (the total number of chunks) andlabels (the vector of chunk labels), create a progress bar, and return a list of two methods:list(update = function(i) {}, done = function() {}). Theupdate() method takesi (index of the current chunk) as the input and updates the progress bar. Thedone() method closes the progress bar. Seehttps://yihui.org/knitr/options/#global-r-options for documentation and examples.

  • The default text progress bar is still written tostdout() by default, but can also be written to other connections orstderr() now. To do so, setoptions(knitr.progress.output = ) to a connection orstderr().

  • Allow concordances to be embedded in HTML output (thanks,@dmurdoch,#2200).

MAJOR CHANGES

  • knit() no longer prints out chunk options beneath the text progress bar while knitting a document (thanks,@hadley,#1880).

  • Due to a change in theevaluate package, the chunk optionsmessage = FALSE andwarning = FALSE will completely suppress the messages/warnings now, instead of sending them to the console. To get back to the old behavior, you can useNA instead ofFALSE (thanks,@gadenbuie,yihui/yihui.org#1458).

  • Thestringr dependency has been removed. All string operations are done with base R now (thanks,@HughParsonage#1549#1552,@rich-iannone#2174#2177#2186#2187#2195#2202#2205).

MINOR CHANGES

  • Improved the error message when inline R code cannot be parsed (thanks,@hadley#2173,@rich-iannone#2198).

  • If the chunk optionchild is used for a code chunk but the chunk is not empty, you will get a warning indicating that this non-empty code will not be executed when you knit the document. Now this warning can be silenced byoptions(knitr.child.warning = FALSE) (thanks,@jwijffels,#2191).

  • Devices from the packagecairoDevice (Cairo_pdf,Cairo_png,Cairo_ps,Cairo_svg) are no longer supported since the package has been archived on CRAN for more than a year (thanks,@jessekps,#2204).

BUG FIXES

  • Thesql engine now correctly prints tables withNA in the first column (thanks,@mariusbommert,#2207).

Contributors

  • @hadley
  • @jwijffels
  • @dmurdoch
  • @gadenbuie
  • @rich-iannone
  • @HughParsonage
  • @jessekps
  • @mariusbommert
hadley, jwijffels, and 6 other contributors
Loading
eitsupi, bgautijonsson, and camilogarciabotero reacted with hooray emoji
3 people reacted

knitr 1.41

25 Jan 14:26

Choose a tag to compare

NEW FEATURES

  • Added support for generating Jira tables viakable(, format = 'jira') (thanks,@pedropark99#2180,@mruessler#2024).

  • Added a new chunk optionfig.id. When it isTRUE, the chunk optionout.extra will gain anid attribute for each image from a code chunk in R Markdown (thanks,@jooyoungseo,#2169). By default, the attribute consists of a prefix, the chunk label, and the figure number. Seehttps://yihui.org/knitr/options/ for detailed documentation offig.id.

  • Added an argumentexact topandoc_to() andpandoc_from() to decide whether to use/return the exact Pandoc output/input format name. If not (default), Pandoc extensions will be removed from the format name, e.g.,latex-smart will be treated aslatex.

BUG FIXES

  • Plot created outside ofknit() could sneak intoknit_child() results (thanks,@niklaswillrich,#2166).

  • User-provided background colors for code chunks in.Rnw documents may fail (thanks,@nielsrhansen,#2167).

  • tabularx andxltabular tables should work without captions (thanks, @amarakon,#2188).

Contributors

  • @nielsrhansen
  • @mruessler
  • @niklaswillrich
  • @jooyoungseo
  • @pedropark99
  • @amarz45
nielsrhansen, mruessler, and 4 other contributors
Loading
Previous134567
Previous

[8]ページ先頭

©2009-2025 Movatter.jp