Just to clarify some points
Your RStudio version is not relevant for your problem because the IDE is independent of your R package library.
You get that error message because there is no R package called melt, you are most likely referring to the melt() function from the reshape2 package.
Also, as @nirgrahamuk mentioned, it would be better to use the pivot_longer() function from the tidyr package (which supersedes the old reshape2 package).