Learning ggplot2 for Biology 109/110

In preparation for our next meeting, I set about learning some basics of ggplot 2, and I constructed an RPub based upon the things that I learned.  The RPub link is here:

http://rpubs.com/jmcmahon/267850

This RPub is a very basic introduction, but I plan on learning more of the bells and whistles for upcoming RPubs that I’d like to write.

One note for creating RPubs using Mac OS: I was encountering a stubborn error when I was trying to knit my R Markdown.  When I went onto the message boards, I found that my version of the MacOS removes some of the X11 library during updates.  When you try running programs that open a graphics window, you will get an error message.  You will need to reinstall XQuartz from the weblink that pops up in the error message in RStudio.

Meeting notes – March 28th

This was our first general meeting.

Attending: 

Nathan Wolfe, Drew Kerkhoff, PJ Glandon, Brad Hartlaub, Chris Bickford, Kathy Gillen, Jen McMahon, Beth Schultz, Karen Hicks, Siobhan Fennessy

Discussion:

We went around the table for introductions and expressions of interest. Multiple people cited interest in “improving my teaching of R”, graphing, and learning R techniques in a social setting.

Brad Hartlaub walked us through a couple of examples of R activities and assignments. (See the related blog posts: 1, 2, 3.) These demonstrated the use of R Notebooks, and the simplicity of publishing those notebooks to a personal (but public) area in RPubs.

Discussion topics included:

Running code easily can create a black box, especially if code is shared  – how do we make sure students are learning stats, and not just running scripts until they get a graph that looks good?

There are R packages that are not in the default load for Kenyon computers. This can add a setup task as required packages may need to be loaded on classroom machines. (Our group should compile a list of desired packages and communicate them to LBIS.)

Publishing your notebooks creates interesting issues around scholarly and classroom openness. What data do you share? Are you worried about plagiarism? Or data privacy?

RPubs does not have a rating or classification system, which means it can be tricky to discover and assess documents in it. How can you tell if a particular document is worthwhile? Right now, much of this is based on considering how you found it – who linked to the doc, from where, and do you trust that source.

Plans for next time:

Next time we’ll look at the ggplot2 package for creating graphics. (Karen Hicks mentioned a good book she consults when using ggplot, and I forgot to write down its title.)

There was some interest in discussing GitHub as a tool for sharing R documents among collaborators (like a lab group). Joe Murphy volunteered to give a general introduction to GitHub at a future meeting, and start looking at how it handles R documents.

Other topics of interest for future meetings included:

  • Data management – creating variables, merging datasets, quick views.
  • For loops
  • Functions
  • Data scraping
There was a brief discussion of including students in future meetings. We agreed that we could learn a lot from student presentations of their particularly creative accomplishments with R, and encourage each other to keep an eye out for such opportunities. However, this group is explicitly not for teaching basic R skills or serving as a support center for coursework.

Example Notebook

Here is an example of an R Notebook that I published using only WordPress. I don’t think it looks as nice as if published in RPubs

I took the following steps to create it:

  1. Create an R Notebook file in RStudio
  2. knit the file to HTML
  3. Open the HTML file in a text editor
  4. Copy all of the text
  5. Create a new page from the WordPress dashboard
  6. Click on the “text” tab (if not selected by default)
  7. Paste the HTML code

First Meeting – January 31, 2017

The purpose of this meeting was to discuss the group’s purpose and who would participate.

Attending:

Chris Gillen, Brad Hartlaub, Joe Murphy, Drew Kerkhoff, PJ Glandon

Kenyon R User’s Group Mission Statement (first draft)

The R Users group is composed of faculty and staff of Kenyon College who use the R programming language in their teaching and/or research. Members discuss nifty strategies, vexing challenges, and shiny new features available in R. Conversations focus on using R and teaching with it, not on the content of courses or scholarship. Users of all levels of expertise are welcomed, but the group is not intended to teach basic R skills.

The plan:

2/21 – Drew and PJ will lead a conversation about how to document and share the code and other resources we discuss.  Brad will show how his classes are using notebooks. This will remain a small group.  In addition to the current group, we will invite Abbie Erler, Marie Snipes, Erika Farfan, and Jen McMahon to get feedback from a broader group.

3/28 and 4/18 – We consider opening these meetings to everyone else in the Kenyon community.