Whether using a library creates a derivative work is not entirely clear. Opinions range across:
- What no, that's silly!
- The running software is a derivative work because it includes the GPL-covered software, but your source code isn't.
- Your source code is a derivative work because it uses GPL-covered APIs (is designed to require that GPL-covered work).
The safest approach is to assume that your snippets might indeed be derivative of the GPL library. Then:
- If the snippets are short or trivial, they may not be eligible for copyright protection and you don't have to do anything.
- Otherwise, they should be available under the GPL. This does not necessarily mean that you have to offer them under the GPL; any compatible license such as MIT or CC0 would work as well.
I would satisfy this requirement by either linking to a complete script from which your snippets are taken and clearly offering that script under a GPL-compatible license, or by putting a license dedication for those snippets at the end of the blog post.
Note that the entire R ecosystem depends on GPLv2-covered software, so this analysis is likely not unique to that package in question.
Output of GPLv2 covered software is NOT subject to the GPL (see the GPL FAQ). You can show plots etc. without any restrictions or attribution requirements.