Compare the codes between 2 or more chunk

Hi, I am working on an rmd file and I have several codes that I need to compare, is there any way to compare the codes and see their differences explicitly?

Thanks,

Hi @Lekmonm,

If you didn't care about where the differences were you could consider using the {digest} package to hash the code chunks and compare the hashes.

But since you want to see the differences, the {diffobj} package provides a good way to do this if you capture your code expressions as strings and use diffobj::diffChr(). Hope this is helpful.

Thank you, very much.