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

Split call_block into a function block_params #1870

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions R/block.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process_group.inline = function(x) {
}


call_block = function(block) {
block_params = function(block, verbose = TRUE) {
# now try eval all options except those in eval.after and their aliases
af = opts_knit$get('eval.after'); al = opts_knit$get('aliases')
if (!is.null(al) && !is.null(af)) af = c(af, names(al[af %in% al]))
Expand All @@ -29,7 +29,7 @@ call_block = function(block) {
label = ref.label = params$label
if (!is.null(params$ref.label)) ref.label = sc_split(params$ref.label)
params[["code"]] = params[["code"]] %n% unlist(knit_code$get(ref.label), use.names = FALSE)
if (opts_knit$get('progress')) print(block)
if (opts_knit$get('progress') && verbose > 0) print(block)

if (!is.null(params$child)) {
if (!is_blank(params$code)) warning(
Expand Down Expand Up @@ -89,6 +89,12 @@ call_block = function(block) {
op = options(params$R.options); on.exit(options(op), add = TRUE)
}

return(params)
}

call_block = function(block) {
params = block_params(block, verbose = TRUE)

block_exec(params)
}

Expand Down
24 changes: 12 additions & 12 deletions inst/misc/tweak_bib.csv
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
"package","author"
"BiplotGUI","Anthony la Grange and N. J. le Roux and P.J. Rousseeuw and I. Ruts and J. W. Tukey"
"CircStats","Ulric Lund and Claudio Agostinelli"
"ElemStatLearn","Kjetil Halvorsen"
"Fahrmeir","Kjetil Halvorsen"
"Hmisc","Harrell, Jr., Frank E"
"Hmisc","Frank E. {Harrell, Jr.}"
"R2SWF","Yixuan Qiu and Yihui Xie and Cameron Bracken"
"R2WinBUGS","Andrew Gelman and Sibylle Sturtz and Uwe Ligges and Gregor Gorjanc and Jouni Kerman"
"RODBC","Brian Ripley and Michael Lapsley"
"RgoogleMaps","Markus Loecher"
"Sleuth2","F. L. Ramsey and D. W. Schafer and Jeannie Sifneos and Berwin A. Turlach"
"ade4","Stéphane Dray and Anne-Béatrice Dufour and Jean Thioulouse and Thibaut Jombart and Sandrine Pavoine and Jean R. Lobry and Sébastien Ollier and Aurélie Siberchicot and Daniel Chessel"
"akima","H. Akima and Albrecht Gebhardt and Thomas Petzoldt and Martin Maechler"
"ash","David W. Scott and Albrecht Gebhardt and Stephen Kaluzny"
"bcpa","Jose Claudio Faria and Clarice Garcia Borges Demetrio"
"BiplotGUI","Anthony la Grange and N. J. le Roux and P.J. Rousseeuw and I. Ruts and J. W. Tukey"
"bitops","Steve Dutky and Martin Maechler"
"cacheSweave","Roger D. Peng"
"cat","Ted Harding and Fernando Tusell and Joseph L. Schafer"
"CircStats","Ulric Lund and Claudio Agostinelli"
"contrast","Max Kuhn and Steve Weston and Jed Wing and James Forester"
"date","Terry Therneau and Thomas Lumley and Kjetil Halvorsen and Kurt Hornik"
"digest","Dirk Eddelbuettel"
"ElemStatLearn","Kjetil Halvorsen"
"epiR","Mark Stevenson and Telmo Nunes and Cord Heuer and Jonathon Marshall and Javier Sanchez and Ron Thornton and Jeno Reiczigel and Jim Robison-Cox and Paola Sebastiani and Peter Solymos"
"Fahrmeir","Kjetil Halvorsen"
"flashClust","Fionn Murtagh and {R development team} and Peter Langfelder"
"foreach","{Revolution Analytics} and Steve Weston}"
"fortunes","Achim Zeileis and the R community"
"gWidgets","John Verzani"
"gee","Vincent J Carey and Thomas Lumley and Brian Ripley"
"gmodels","Gregory R. Warnes andBen Bolker and Thomas Lumley and Randall C Johnson and Randall C. Johnson"
"gWidgets","John Verzani"
"hexbin","Dan Carr and Nicholas Lewin-Koh and Martin Maechler"
"Hmisc","Harrell, Jr., Frank E"
"Hmisc","Frank E. {Harrell, Jr.}"
"leaps","Thomas Lumley"
"mapproj","Doug McIlroy and Ray Brownrigg and Thomas P Minka and Roger Bivand"
"maps","Ray Brownrigg"
Expand All @@ -36,9 +31,14 @@
"pbivnorm","Alan Genz and Brenton Kenkel"
"pscl","Simon Jackman and Alex Tahk and Achim Zeileis and Christina Maimone and Jim Fearon"
"quadprog","Berwin A. Turlach and Andreas Weingessel"
"R2SWF","Yixuan Qiu and Yihui Xie and Cameron Bracken"
"R2WinBUGS","Andrew Gelman and Sibylle Sturtz and Uwe Ligges and Gregor Gorjanc and Jouni Kerman"
"randomForest","Leo Breiman and Adele Cutler and Andy Liaw and Matthew Wiener"
"rgl","Daniel Adler and Duncan Murdoch"
"RgoogleMaps","Markus Loecher"
"rms","Frank E. {Harrell, Jr.}"
"robustbase","Valentin Todorov and Andreas Ruckstuhl and Matias Salibian-Barrera and Tobias Verbeke and Manuel Koller and Martin Maechler"
"RODBC","Brian Ripley and Michael Lapsley"
"Sleuth2","F. L. Ramsey and D. W. Schafer and Jeannie Sifneos and Berwin A. Turlach"
"sm","Adrian Bowman and Adelchi Azzalini"
"tuneR","Uwe Ligges"