I like http://www.cookbook-r.com/ as a general resource.
When asking for debugging help, it's really courteous to be able to articulate:
(1) what the code was supposed to do
(2) what the code did instead
(3) what was already tried and if the problem has been further narrowed to specific lines
[though I think those are the standard requirements for stackoverflow questions, anyway]