Siobhan's Programming Journal #1

This first exercise in R took way longer than I expected and involved quite a bit of Googling to find my way around and figure some things out. I must admit, I had a difficult time navigating R and getting data to load and show on some type of graph--there are some speculations on the internet that R on a Mac requires a bit more configuration than R on a PC, but I’m not all sure about that as yet.


For this exercise, after watching the video on Arne Duncan speeches and reading Yau’s perspective on gathering and handling data (complete with his examples), I tackled the messy Duncan data in an attempt to count and plot the number of times a word was mentioned. At first, I wanted to count and display the number of times a word, for example education, was mentioned in his speech, but that proved to be continuously difficult. I also kept getting many, many errors. image


I then switched my focus and after finally getting the data frame to properly load into R in a way that I could read, I evaluated the speech titles since those were shorter than the entire speech and tried to isolate words that way. I feel like I wasn’t entirely successful, but I was able to get some type of bar plot going to display true and false values.






After that, I was able to convert it to a table to isolate words and frequencies, then back into a data frame and plot words from there. It did give me a bit of frustration, trying to do all of these searches, and coming across so many solutions that were completely unhelpful. However, I do feel proud of myself for being able to make some progress, and at least have a functioning data frame to count word frequencies.


    • Dana Paniagua
      Dana Paniagua

      Hi Siobhan,

      You did a great job counting word frequencies. You are much further along than I am! I really had a tough time with the messy Duncan data. How did you end up getting the data into a readable format in R? I too spent a lot of time on tutorials that weren't helpful and I did experience difficulty on a Mac, which is interesting you should mention. 

      • Siobhan Wilmot-Dunbar
        Siobhan Wilmot-Dunbar

        Hey Dana! 

        Glad I wasn't alone in the struggle with my Mac! So for this I saved the file as a txt itself on my computer through Excel, then in R, there's that section on the bottom right, I went to Files then navigated to that file where I saved it in that window. Click on it, then click Import Dataset then a box appears, then I clicked Import again at the bottom. It took a bit to load, then in R, I typed View(FileName) then it loaded an I was able to at least see the dataset as the table. 

        I had a bit of a tough time also and took so much time just getting the data to import into R. I tried the read.csv code I found online but for some reason that didn't work out for me, so I just did the manual upload for now and that seemed to be working. I hope this works for you also! 

      Quantitative Literature Analysis Spring 2018

      Quantitative Literature Analysis Spring 2018

      Here is the online home for our Quant Lit Analysis Class for Spring 2018.