DSVIL Write-Up

My write-up for the NCSU Data Science and Visualization Institute for Librarians is published in the NNLM MidContinential Region’s newsletter (recently renamed The MidContinental Messenger)!



New Publications


Quick updates: what an exciting month this has been! This week I signed up for my figshare account and got a DOI for my LibGuides Project Team poster. My plan now is to turn this poster into a write up and publish it somewhere. Where? TBD.

Mellanye Lackey presented the other poster I was co-author on.


Earlier this month, my short piece for the MLA News Technology column was also published. If you’re an MLA member, please enjoy. If you are not, the gist of it is in my post here.

Highlighted Tools for Advanced Searching

This post is long overdue. In May at MLA 2016, I attended a CE course on Advanced Searching Techniques and Advanced Strategy Design with Julie Glanville and Carol Lefebvre. About half of the material they presented was completely new to me, and one of the most useful sections they covered was on tools that help with building a search strategy. During the conference, they each presented at a Sunrise Seminar and highlighted some more tools.

In no particular order, check these out for identifying subject headings, keywords, top authors, top publications, and other text mining capabilities…

In addition, they noted that EndNote can be used to create a “reference list” of MeSH or EmTree term frequency. I haven’t tried this yet, but sounds promising if you can figure out how to get the MeSH and EmTree terms imported into the EndNote library.

Other mentioned resources of interest:

For more on the CE course, see my storify: https://storify.com/shirl0207/mla-2016-ce300-w.

For more on discussions around systematic reviews from MLA 2016, see https://storify.com/shirl0207/mlanet16#a36837.

Latest Iteration of CV

I haven’t looked at my CV since last March when I applied for promotion from Library Professional I to II at Dartmouth College. Although librarians aren’t considered faculty, there does exist a career ladder. It was quite a time-consuming feat to put it together the first time.

This time around, I spent 3 days (on and off) and moved the content into a new template on the Overleaf platform. Check it out!


I’ll probably keep this iteration for a good few years. The last one lasted 3 after all.

Sending Confirmation Emails with Calendar Attachments after Google Form Submission

In short, today I succeeded in writing a script that will send a confirmation email with an iCal attachment after someone submits the conference registration form (a Google Form).

Here’s what I needed:

  • Email confirmation upon form submission.
  • Email would include their answers to some key fields and other pertinent conference information.
  • Ideally the email would come from my utah.edu address rather than my Gmail.
  • If recipients replied, the message should be sent to a listserv of conference organizers.
  • Include a calendar file so that recipients can easily add the event to their own calendars.

I started with exploring the add-ons in Google Forms and tested “Form Notifications” which worked pretty well but it was too basic and didn’t allow for including answers or attachments. It does include a feature that will send me an email every 10 responses (can change this number).

Then I found this video/article that goes through setting up a script to include attachments (see also part 1). It didn’t work for me but it did get me started writing and tweaking javascript (and jumping around all over the forums and brushing up on syntax). But definitely start with the video to get the gist of how it works.

Here’s the final code (generalized):

Assume the form entry fields are “Name”, “Email”, “RSVP”, and “Dietary Restrictions”. Insert your information where you see <these brackets>.

function myFunction(e) {
  var userName = e.values[1];
  var userEmail = e.values[2];
  var rsvp = e.values[3];
  var diet = e.values[4];

  var subject = "Confirmation: <Name of Conference> - <Date(s)>";
  var message =  "Thank you, " + userName + ", for registering for the conference. " + 
    "For your convenience, a calendar event has been attached. " +
    "\n\nConference RSVP: " + rsvp + 
    "\nDietary Restrictions: " + diet + 
    "\n\nIf you have any questions, please email us at <listserv email> or see the FAQs at <website>. ";
  var cal = DriveApp.getFileById("<id>");
  var calFile = cal.getAs("text/calendar");

  GmailApp.sendEmail (userEmail, subject, message, {
    from:"<Gmail alias>",
    name:"<name of sender or conference name>",
    replyTo:"<listserv email>",

And now the little things I learned along the way…

Where to create the script

This one took me a while to figure out. IMPORTANT! You don’t want to create the script in your Google Forms interface; you want it in the spreadsheet of responses! The trigger happens when a new entry is added to the spreadsheet. And make sure when you add the trigger, you allow it access to your Gmail and Drive.

Setting variables

For ease of calling the data, you want to set some variables to refer to the different data entries. Google Spreadsheets number their columns starting with 0 (which is usually the timestamp for Forms data).

Why GmailApp instead of MailApp

Because I wanted to control the replyTo parameter, MailApp could not handle the line breaks in the message. This forum answer solved it for me by suggesting GmailApp instead. Plus with GmailApp, I can now use my utah.edu email! For more parameters, see the documentation.

How to get another email address to be a Gmail alias

Follow these instructions.

If you’re affiliated with The University of Utah, the first screen is your utah.edu email and leave the alias box checked. On the next screen, use your uNID credentials to login. Then follow instructions in the confirmation email to verify changes. Now you can send email under your utah.edu address.

How to make a calendar file and insert it as an attachment

For simplicity (and familiarity) I used Outlook to create an event and then saved it as an .ics file. You can probably do this in Google Calendar, but I didn’t explore this route. Then upload the file to Google Drive. When you click on “Get shareable link” you can see the “id” that you will need for the code above (just the string of letters and numbers after the “id=” piece of the URL).

Testing the script

The only way to test it is to actually fill in the form because the email is triggered when the entry appears in the spreadsheet. For the record, I tested it no less than 36 times. If you don’t get an email within 30 seconds, it didn’t work and the code needs tweaking. Debugging is actually not easy since the interface does not always tell you you’re missing a semicolon or have an extra comma somewhere.

And there you have it! Hope that saved you a couple of hours. However, there’s nothing like the feeling you get when you’ve struggled for a while and then the email with the calendar attachment arrives in your inbox and you just shout with joy in your open office… YEA!

Teaching ggplot2

titleslide_ggplot2Last week I gave a short presentation to a math class on advanced graphing in R with ggplot2. Click here to view the updated presentation: http://goo.gl/QNQjuV

I think the session went well overall. The students are masters and PhD candidates who are interested in learning more statistics and applied math. Their course textbook uses R for basic graphing and the professor thought it would be nice to introduce more advanced graphing. While I don’t know much about multilinear models, I do know a thing or two about advanced graphing in R.

One hitch: I’ve never taught R or ggplot2 before. I use it in my work at the library, but teaching it is a whole other animal. I spent a week pondering the best way to show how ggplot2 is superior to base graphics. Other constraints included time (50 minute class) and students bringing their own installations. Ultimately, I decided the best way is to show comparisons and then allow time for them to try it for themselves.

Post-session things I learned, including feedback received:

  1. Prepare a structured exercise. I let them loose and they needed more direction so the updated presentation has a couple slides.
  2. Post the slides ahead of time. This was actually not very easy to do since WP doesn’t host HTML files and Dropbox makes you download the file…
  3. Presentation only took about 20 minutes. So for future presentations, I threw in a couple more slides after the Exercise slide about even more advanced graphing.

This presentation would probably fit pretty well in a lunchtime tech series, much like Eccles Express from a few years ago. I can see making a series of short presentations around using R. Maybe a breakdown like this?

  1. Setting Up to Learn R
  2. Basics of Using R (this one might need to be split into two parts)
  3. Basic Graphing in R
  4. Advanced Graphing in R
  5. Writing in R Markdown