render rmd by walk2 , x=vector of variables, y=one variable

**walk2 to render rmd as one report .html file. **

LR.Rmd :YAML
------------------
params:
** x: **
** value: !r c("Cmax","Cmin")**
** choices:**
** - !r c("Cmax","Cmin")**
** y: 'res'**
---------------------------------------------------

x= c("k", "m", "f")
purrr::walk2(
** list(x, y = 'res'), ~ rmarkdown::render('/home/LR.Rmd',**
** output_file = paste("test", .x, ".html"),**
** params=list(x=.x, y=.y)))**
-----------------------------------------------------------------
Error in map2(.x, .y, .f, ...) : **
** argument ".f" is missing, with no default

--------------------------------------------------------------------------
can anybody comment on resolving this issue?. same code works fine when x= one variable.

If you look at the documentation, you'll see that walk2 does not take a list of x and y as first argument. You get the error because you did not provided 3 arguments.

You are probably working with pwalk() in mind or just need to change the way you are calling the function.

Nothing related to rmarkdown is this issue I believe.

Also please format your question correctly :

FAQ: How to Format R Markdown Source

thanks, got it, used pmap instead map2, worked.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.