Hi Sanjana,
at the moment I didn't find a good solution, so I just applied a trick that I don't like but it works.
So I copied the r function code directly inside the server.r file, so that now the r functions are loaded directly inside it.
Maybe this is not the correct way (my server.r file has know more than 3000 rows...), and I cannot says if the loading can take a little extra-time with this solution.
I think that the correct way should be to create, test and develop an r package containing your function/s, then distribute and publish it on the Cran or the GitHub using devtools. So in this way you will load your function just loading the package, using library("...") in the server.r file, but this work requires time.
Let me know if you find a smarter way to do it :)
Thank you!!!