I'm trying to create a file word starting from a program that on console perfectly works.
The problem is that when it reaches a function that uses
cannot find melt function
Installing a package is not enough — you need to load it. It’s possible that it works in your console because it was still loaded from before, or because you installed it in the current session.
To use the package, you need to add the following into your (R Markdown) code, before using any of its functions:
Alternatively, you can just prefix all its functions with
reshape::. So, instead of calling
melt, you’d call
reshape::melt. That’s less commonly done but there’s nothing wrong with it.