An error just prompted up when I process an .Rnw file using RSudio:

Loading required package: knitr
Warning message:
package ‘knitr’ was built under R version 3.1.2 

processing file: PROVIDE_definition_f9pr1.Rnw
Error in parse_block(g[-1], g[1], params.src) : duplicate label 'match'
Calls: knit ... process_file -> split_file -> lapply -> FUN -> parse_block
Execution halted

I think it is related to package knitr, but I have no idea where the error come from. Does anybody know what happened?

  • First a MWE of the code generating the error is needed. From the error message I infer that the problem is will bad R code in one of the R-blocks in your Rnw file. Recommend that you copy out each R Block and execute them separately in the R console (separate for IDE like RStudio) to find the syntax error. Commented Jun 25, 2015 at 15:56
  • 2
    Why did someone vote to close because it's unclear what is being asked? I'm voting to leave this open. Yes, there's no MWE, but there is an accepted answer. The error message is pretty straightforward, and Yihui figured it out and gave an answer, which the OP accepted.
    – Adam Liter
    Commented Jul 1, 2015 at 4:40

1 Answer 1


It suggests that you have at least two code chunks with the same label match, like this



Duplicate labels are not allowed in knitr.

Not the answer you're looking for? Browse other questions tagged .