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.