I can't solve error to knit :: Error in parse_block(g[-1], g[1], params.src) : duplicate label 'setup'



This is my code..

I keep getting this error. (Error in parse_block(g[-1], g[1], params.src) : duplicate label 'setup')
I do not know why. If you know how to fix it, please help me. :disappointed_relieved::disappointed_relieved:


This error could appear if you named two chunks with the same name in your document. here it seems there are 2 chunks names setup.

Can you check in your Rmd document ?

I don't know if this is related, but I did not quite understand your printed screen : Are you calling render from inside another chunk? form another document ? The error may come from SEQprocess_Introduction.Rmd that also contains a setup chunk. Have to try to render the document from the console ? If you do that, have you still an error ?


I've fixed this issue. But this time 'Error in sink(con, split = debug) : sink stack is full' ..

This is all the relevant chunks of knit.

If you have any idea about this, can you help me?


sink is useful to divert the output of R somewhere. Here it seems to be a connection to a file con where the R output are diverted and if debug=TRUE, the output is also printed in the current stream (the console I think).

It seems there somewhere, it can't manage to deal with the sink stack in your case. You can try isolate the issue. It is difficult to know more from afar with just this screenshot.

Out of curiosity, did you try to render from the console with rmarkdown::render and not from another Rmd document ? It could help understand where this comes from


I had this same issue. I like to do all my evaluation at the top of my .R script, write what i need to in the middle (using what was evaluated above), and then print all the code chunks (with eval = FALSE) at the bottom when it is compiled (yes! you can render a md directly from R!). In order to ensure that markdown/spin does not think I have two code chunks named the same thing, I needed to put a line space #' in between the code chunks.