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.
Publication of an article about R code (in package form) is definitely a possibility. Whether your particular code is publishable is something for the reviewers to judge. There is always The R Journal, which is peer-reviewed and read by most serious R programmers. Journal of Statistical Software is a more general outlet that is not R-specific.
I see a lot of projects where a substantive article is published in a disciplinary journal (perhaps describing the algorithm or using software in a particular application) and then an accompanying piece describing the software specifically is published in JSS or The R Journal.