2

I recently answered a SO question and got criticized for not attributing a commenter. He had provided a snippet of code that's obviously the right approach but falls short of a full answer. In my fuller answer, I had come up with the same code independently but copy-and-pasted what he provided to save some typing. Am I really in the wrong here?

Here's the exchange: Problems fixing character vectors in R with gsub()

6
  • 4
    I'm already pretty tired of this, but the snippet was: gsub("_|\\.\\.\\.|\\." , "" , Smallstore1 ), your full, and unedited (second) attempt at an answer was... names(Smallstore1) <- gsub("_|\\.\\.\\.|\\." , "" , Smallstore1), along with some explanatory text at the bottom which replicates what I said in my original comment! Commented Aug 5, 2014 at 0:03
  • Right. Then I edited my answer to: names(Smallstore1) <- gsub("_|\\.\\.\\.|\\." , "", names(Smallstore1)), because otherwise it's inaccurate. The explanatory text pointed out that the poster had used gsub incorrectly, something that any good answer should address, in my opinion.
    – rsoren
    Commented Aug 5, 2014 at 0:06
  • I'd also like to point out that the poster made an edit: "EDIT: I tried two solutions suggested in the comments, but they did not fix the character vectors." and subsequently accepted my answer.
    – rsoren
    Commented Aug 5, 2014 at 0:11
  • And ironically enough it was I who pointed out why it didn't work to the OP and how to fix it, using "your" solution (which was edited after a suggestion pointed out by yet another user which you also fail to mention here). Geez. And again you are being disingenuous, because they also left a comment on your answer stating it didn't work for them!!!! Commented Aug 5, 2014 at 0:16
  • Closely related, but not an exact duplicate: Is it OK to take someone else's comment and post it as your own answer?.
    – user456814
    Commented Aug 5, 2014 at 0:22
  • 1
    No, it's not okay without a mention of the comment. But people do it all the time on SO let's find the duplicate and move on with our lives....P.S. in all honesty, that not a real nice regex anyway Commented Aug 5, 2014 at 1:33

2 Answers 2

7

The R community on SO is fairly small. A lot of the same people will leave a quick comment with some untested code rather than provide an answer, usually because they lack the time or means to test the code when the comment is entered.

So while it is absolutely not a requirement to attribute code in comments, you should do so. The same small group of people contributing to the R tag are those who may or may not upvote your questions and answers.

0
4

Attributing content in comments is polite, but as a requirement for posting answers... Well, I think it's overkill, especially if you're trying to cobble together a coherent answer from a mishmash of comments. Your attributions would be longer than the actual answer.

If the comment contains clearly substantial content, it would be nice if you attribute it. But it would also be nice if the poster of the comment posted an actual answer instead of a comment, if they want their content sufficiently legitimized that it deserves attribution. Technically, all content falls under CC:Wiki, but comments are not meant to be permanent content anyway.

1
  • 2
    I actually argued that you should cite the comment, but I agree with you that if you're cobbling together an answer from multiple comments, then giving attribution to each and every one of them is impractical, and would make your answer harder to read and follow (more clutter and noise, less signal). I would probably just at least say "As mentioned in the comments..." in that case, but that's just me personally.
    – user456814
    Commented Aug 5, 2014 at 0:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .