Can a routine in R be published in academic journals? I have developed a routine in R for longitudinal analysis of networks. I was wondering whether it can be published on an academic journal as a dedicated article?
Depending on the extent of your work, you may be able to get a paper describing your package and methods in PLoS One or a similar journal, or the Journal of Statistical Software.

Alternately, The R Journal is a peer-reviewed journal covering R software, which may be an appropriate venue if you don't have enough methodological material to build out a full paper for another journal

Finally, many journals accept code supplements for papers describing the use of your method, so you may be able to publish your routine's in a paper about the actual work you are doing.