<h3>Consider taking a long-term view and writing a new package</h3>
<p>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 &quot;gaps&quot; 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.</p>
<p>I speak here as someone who has done this quite a few times on this site.  I have written three <code>R</code> packages (<a href="https://CRAN.R-project.org/package=stat.extend" rel="nofollow noreferrer"><code>stat.extend</code></a>, <a href="https://CRAN.R-project.org/package=ts.extend" rel="nofollow noreferrer"><code>ts.extend</code></a> and <a href="https://CRAN.R-project.org/package=utility" rel="nofollow noreferrer"><code>utilities</code></a>) 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., <a href="https://stats.stackexchange.com/questions/180779/482928#482928">here</a>, <a href="https://stats.stackexchange.com/questions/171458/482752#482752">here</a>, <a href="https://stats.stackexchange.com/questions/289008/461606#461606">here</a>, <a href="https://stats.stackexchange.com/questions/410534/494363#494363">here</a>, <a href="https://stats.stackexchange.com/questions/145823/494362#494362">here</a>, <a href="https://stats.stackexchange.com/questions/494612/494692#494692">here</a>, <a href="https://stats.stackexchange.com/questions/458455/502166#502166">here</a>, <a href="https://stats.stackexchange.com/questions/12164/494366#494366">here</a>, <a href="https://stats.stackexchange.com/questions/502689/502701#502701">here</a>, <a href="https://stats.stackexchange.com/questions/37437/494360#494360">here</a>, <a href="https://stats.stackexchange.com/questions/498035/505483#505483">here</a>, <a href="https://stats.stackexchange.com/questions/43159/504974#504974">here</a>, <a href="https://stats.stackexchange.com/questions/397799/397842#397842">here</a>, <a href="https://stackoverflow.com/questions/52399474/66054980#66054980">here</a>, <a href="https://stackoverflow.com/questions/53243565/65100073#65100073">here</a>, <a href="https://stackoverflow.com/questions/27821238/65100239#65100239">here</a>, <a href="https://stackoverflow.com/questions/31997361/65100187#65100187">here</a>, <a href="https://stackoverflow.com/questions/60933803/65100104#65100104">here</a>, <a href="https://stackoverflow.com/questions/42986446/64707395#64707395">here</a> and <a href="https://stackoverflow.com/questions/22284502/64707446#64707446">here</a>) 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.</p>
