For advice see
If your question is about Programming, ask on Stack Overflow. If the language is statistically oriented (such as R, SAS, Stata, SPSS, etc.), then decide based on the nature of your question: if it needs statistical expertise to understand or answer, ask it here; if it's about an algorithm, routine data processing, or details of the language, then please refer to the collection of links to resources we maintain.
I don't see a statistical core to your question, so my advice is that your question would be off-topic.
To help understanding, know that Stack Overflow both predates Cross Validated and carries a large number of questions on R. It is true that many questions here mention R, which is fine if there is a statistical question at the core. Nevertheless, this is not a forum for any questions about R, or indeed any other software, statistical or not.
Having mentioned Stack Overflow, I don't see that your question is suitable for that forum either, and in turn I suggest you read their help.