Consider taking a long-term view and writing a new package
One thing that is worth bearing in mind in regard to this query is that questions on CV.SE (particularly if they are fairly regular questions) can give a useful indication of "gaps" in the market for software tools to perform a particular task. If you have sufficient expertise to write code to implement some task (where that task is not already accomplished well in an existing package) then it is worth thinking about whether you might want to turn that into a bigger project where you write and publish a more comprehensive package to assist users with methods of that kind. If you are willing to do that then you might possibly create something of broader value, and you can also come back to the question later and make reference to your published package. Of course, this is a large amount of work, so it is generally only a good idea when you observe a set of questions that ask about similar things, and this provides the impetus to create a suite of functions that accomplish a broad range of tasks that answer those questions.
I speak here as someone who has done this quite a few times on this site. I have written three R
packages (stat.extend
, ts.extend
and utilities
) that largely came out of writing functions to solve problems from users who asked questions on this site. (Of course, all of these packages are quite general, and they do a lot more than answer the specific questions that initially motivated them, but that was the impetus for starting each of the packages.) I have answered a whole bunch of questions on CV and SE (see e.g., here, here, here, here, here, here, here, here, here, here, here, here, here, here, here, here, here, here, here and here) where the answer shows how to use one of those packages to solve the question at issue. In some cases, the question was asked before I had written the package, but it served as part of the motivation for creating the package. Writing these packages allows me to give simple user-friendly answers to all questions that ask for implementation of the kinds of problems in the original questions that motivated package.