<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lois Wakili on Medium]]></title>
        <description><![CDATA[Stories by Lois Wakili on Medium]]></description>
        <link>https://medium.com/@wakili35?source=rss-616477f08641------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6mA6aezZ6XCgq5tv_ZllBg.jpeg</url>
            <title>Stories by Lois Wakili on Medium</title>
            <link>https://medium.com/@wakili35?source=rss-616477f08641------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 19:07:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wakili35/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Get started using R programming for data analysis, Part 1.]]></title>
            <link>https://medium.com/@wakili35/get-started-using-r-programming-for-data-analysis-part-1-25065d53649a?source=rss-616477f08641------2</link>
            <guid isPermaLink="false">https://medium.com/p/25065d53649a</guid>
            <category><![CDATA[r-programming-language]]></category>
            <category><![CDATA[r-programming]]></category>
            <category><![CDATA[data-analysis-courses]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Lois Wakili]]></dc:creator>
            <pubDate>Fri, 09 Jun 2023 09:18:13 GMT</pubDate>
            <atom:updated>2023-06-09T09:18:13.245Z</atom:updated>
            <content:encoded><![CDATA[<h4>Every beginner&#39;s guide</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*99WhOcGuJDYAhayKcd6uJw.png" /></figure><p>Greetings Humans, I hope this post finds you all well.</p><p>So, after hearing much about the language, you’ve gone ahead and installed R Studio and are really wondering where or how to start. Fret not, brave warrior; this should guide you through your first analysis with little to no hassle.</p><p>In this post, we’ll cover some basic R functionality while working on a dataset.</p><p>Now, I’ve always believed that a learn-by-doing approach was the absolute best when it came to programming; hence, we would learn concepts or functions as we needed them, and hopefully, you can too.</p><h4>Our workspace</h4><p>For tidy and organized code, commenting is a technique that has been employed by programmers to enable easy readability of code. Commented lines aren’t run by the program, so it comes in handy like a notepad to put down our thoughts and/or different variations of code snippets. In R, we use the hashtag ‘#’ to initiate a single-line comment.</p><pre># ---------------------------------<br># --- R FUNDAMENTALS TUTORIAL ----- <br># ---------------------------------<br><br># Basic data analysis </pre><p>Next, we would proceed to the first bit of our analysis, actually ‘every’ analysis, which is the dataset we want to analyze. Normally, if we had an external file, we would load that into our environment using specific functions for that; however, in this case, we want to build a small dataset from scratch and learn about different data types as we do.</p><p>To do this, we want to create small collections of data that will eventually build up our dataset. In R, you create a collection using ‘c()’, This tells R that we want to list out more than one element. We then assign this collection to a variable, which is some sort of container that holds data for easy reference later on. We use the assignment variable ‘&lt;-’ for that.</p><p>Let&#39;s create our first collection while introducing one of the data types in R, a character; Here we have created a variable called ‘day_of_week’ to store the days of the week.</p><pre># The character: Basically your strings, letters they are surrounded by double quotes<br><br>day_of_week &lt;- c(&quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;, &quot;Sunday&quot;)</pre><p>Then we have another datatype, the logical.</p><pre># The boolean: comprises of true and false and can be written out in full or with the first letter<br>had_breakfast &lt;- c(TRUE, FALSE, TRUE, T, T, T, F)</pre><p>Next is the numeric.</p><pre># The numeric: which is your decimal/floating point numbers<br><br>body_temp &lt;- c(34.2, 33.6, 36.2, 35.5, 35.7, 33.9, 37.0)</pre><p>And we also have the integer.</p><pre># The integer: which are just your whole numbers<br>classes_taken &lt;- c(2,1,3,2,1,-4,2)</pre><p>We would go ahead and run these variables, and they would be saved in memory in the global environment of R Studio. If we decide to view these variables, we would get the results as such</p><pre>&gt; day_of_week<br>[1] &quot;Monday&quot;    &quot;Tuesday&quot;   &quot;Wednesday&quot; &quot;Thursday&quot;  &quot;Friday&quot;    &quot;Saturday&quot;  &quot;Sunday&quot;   <br>&gt; had_breakfast<br>[1]  TRUE FALSE  TRUE  TRUE  TRUE  TRUE FALSE<br>&gt; body_temp <br>[1] 34.2 33.6 36.2 35.5 35.7 33.9 37.0<br>&gt; classes_taken<br>[1] 2 1 3 2 1 4 2</pre><p>Great! Now we are making some headway. Let&#39;s go ahead and create a data frame using these. A data frame is a data structure comprising columns and rows that can contain different data types. This structure is what most of the data we see in spreadsheets resembles.</p><p>We use the ‘data.frame()’ object to create a data frame; however, if we were working with external data, once the file is read in, it is automatically done.</p><pre># Creating a dataframe with the collections created above, the input would <br># represent the columns<br>first_df &lt;- data.frame(day_of_week, had_breakfast, body_temp, classes_taken)<br><br># viewing the results<br>first_df</pre><pre>&gt; first_df<br>  day_of_week had_breakfast body_temp classes_taken<br>1      Monday          TRUE      34.2             2<br>2     Tuesday         FALSE      33.6             1<br>3   Wednesday          TRUE      36.2             3<br>4    Thursday          TRUE      35.5             2<br>5      Friday          TRUE      35.7             1<br>6    Saturday          TRUE      33.9             4<br>7      Sunday         FALSE      37.0             2</pre><p>And there you have it—your own custom-made data frame, which you could export and make available to other users. However, we do not want to use this as I would not want people to know whether I had breakfast or not before writing this post. ;)</p><p>Now we can go ahead and do some basic analysis.</p><p>When analyzing data, we want to explore our dataset first to get a feel for how we will be working with it. Think of this as getting a snapshot of the data to work with, which is vital, especially when you have large amounts of data to work with.</p><p>In R, we’ve got the str() method, which gives an overview of the structure of the data. Here are a few other methods you can use:</p><pre># viewing the structure of our dataframe<br>str(first_df)<br><br># result<br>&#39;data.frame&#39;: 7 obs. of  4 variables:<br> $ day_of_week  : chr  &quot;Monday&quot; &quot;Tuesday&quot; &quot;Wednesday&quot; &quot;Thursday&quot; ...<br> $ had_breakfast: logi  TRUE FALSE TRUE TRUE TRUE TRUE ...<br> $ body_temp    : num  34.2 33.6 36.2 35.5 35.7 33.9 37<br> $ classes_taken: num  2 1 3 2 1 4 2<br><br># viewing a statistical summary of our dataset<br>summary(first_df)<br><br># result<br> day_of_week        had_breakfast     body_temp     classes_taken  <br> Length:7           Mode :logical   Min.   :33.60   Min.   :1.000  <br> Class :character   FALSE:2         1st Qu.:34.05   1st Qu.:1.500  <br> Mode  :character   TRUE :5         Median :35.50   Median :2.000  <br>                                    Mean   :35.16   Mean   :2.143  <br>                                    3rd Qu.:35.95   3rd Qu.:2.500  <br>                                    Max.   :37.00   Max.   :4.000<br></pre><p>So far, we have been using base R functions and methods, which are available with the default R installation, however, there are other libraries that have been made available in R that provide additional functionality when working with R and kinda extend the abilities of base R.</p><p>The ‘tidyverse’ is one library that contains a couple of other useful libraries. To use a library, you need to install it and load it. Like so;</p><pre># installling tidyverse<br>install.packages(&quot;tidyverse&quot;)<br><br># loading the package<br>library(tidyverse)</pre><p>Running this is like a whole world of possibilities has just been opened, and we can use this to make our analysis easier, better, more enjoyable, and even faster.</p><p>Now that we have some new libraries installed, we would like to look at some key methods in the dplyr library that would help us wrangle our data. They are the</p><p>select(), filter(), mutate(), arrange(), summarise()</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25065d53649a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Used Simple Spreadsheet Functions and a cup of tea, to analyze a Data set.]]></title>
            <link>https://medium.com/@wakili35/how-i-used-simple-spreadsheet-functions-and-a-cup-of-tea-to-analyze-a-data-set-5c2ab3ce825?source=rss-616477f08641------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c2ab3ce825</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Lois Wakili]]></dc:creator>
            <pubDate>Wed, 26 Jun 2019 22:31:33 GMT</pubDate>
            <atom:updated>2019-06-26T22:31:33.599Z</atom:updated>
            <content:encoded><![CDATA[<p>So, I recently attended the Gitgirl School of data and I had to complete certain projects to be able to move forward and practice already learnt concepts, as any school would. Now, I&#39;m going to keep this post interesting by including some other personal details as to how I got here. Its important I capture my reader’s attention as well as keep it, so they don&#39;t ‘skip’ to the next post after enduring the very first paragraph of mine. Okay, so lets move on.</p><p>I always believe that people who write code are the world changers, I mean, how cool is it, that one is able to tell a machine what to do, and it obeys, unlike some human beings who seem difficult to control (Not that I&#39;m a colonial master or anything, LOL).</p><p>So, I learnt how to use functions like SUM, COUNT, AVERAGE, SUMIF,MATCH, ROUND, AGGREGATE, INDEX, SORT and a couple more. I&#39;m just going to talk about the ones I used for this particular project.</p><h3>The Data Set</h3><p>So to understand this post, you’ll have to know what the given dataset was all about. Its a record of Sales made by a store from the year 2014 to 2016 and as expected, the data was a little disorganized. it had several rows and about 10000 columns. Yep, I know what you’re thinking, that’s a whole lot of figures, but it was easy to sort through the entire data set in a short time.</p><p>I usually like to do a little bit of massaging before I start to study any dataset. what I mean by that is, I try to differentiate my headers from the rest of the data by making them bold and/or italicizing them. I also freeze the first row and column, (i.e. the ones containing the header and serial numbers) so that no matter how far I am in the worksheet, I am never lost. I also expand the cells so that no overlapping text is hidden. so you see, a little touching here and there and After doing all that, the worksheet looks like this;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*oSYEfT-Ur-45QZb3o9QsGA.png" /></figure><p>Now, with my worksheet looking like this, i can easily understand the data set and start my analysis.</p><p>Now, for this particular project, I didn&#39;t have to brainstorm questions, I was already given a set of questions to answer. For Instance, one of my favorites was the CONCATENATE function. As the name implies, it joins two different strings together (if you&#39;re familiar with a bit of programming). I had to Join the State column and the Region column. Seeing that these functions are already inbuilt, once you type it in your worksheet, the arguments to fill in pop up and with that I was able to create another column which would now contain the joined columns. The best part was, I only typed the formula once, all I was left to do was ‘click and drag’ automatically, the same formula was applied to the remaining 9995 cells.</p><p>Now, i actually started this project of mine after the deadline for submission had passed. we were given approximately 3weeks to study the course content and work on the project slash write a blog post, as i am doing now. I didnt know how time had passed until the final submission day came and hit me right in the face. I had to plead for an extension and promised to be done in three days, sounds like a suicide mission right?, I know, but never underestimate the power of an analyst, at times you would have to meet up crazy deadlines and work under a lot of pressure. I started to study the curriculum while simultaneously working on the project, anytime I got stuck, I would refer back to the lessons, and when I felt my head was getting messed up, I would check WhatsApp, reply few messages, laugh at status updates and continue working. This kept me from going insane. Honestly.</p><p>I was also asked to calculate some sales and so the SUM function was there for me. all I had to do was type in the SUM function in a cell, and input the range I wanted added up, which in this case would be the entire sales column, and boom! I had my grand total in seconds.</p><h3>The Hard Part</h3><p>For me, when I got to the part where I had to create a VLOOKUP, I froze because each time I tried to make a move, I got an error. At some point, I thought my computer was fighting me, not until I settled down and a few hours later, I got the hang of it. Basically, VLOOKUP means Vertical lookup, and like the name implies, it looks up stuff, vertically. After going through some hurdles, I can now say, I&#39;m a VLOOKUP guru, and that&#39;s an example of what the learning process can be like.</p><h3>The Cherry On the Pie</h3><p>So here I am, writing my very first official blogpost about something I learnt, so others can read and learn too, smiling, cos I made it through my project. I was able to answer all the questions asked, used my functions properly and now I&#39;m feeling pretty good about myself. In this study, I didn&#39;t have to create any visual presentation, hence no graphs or charts to display. I have currently set a reminder on my TV for “How I met your Mother” one of my Favorite shows, because, I know I&#39;ll be done with this, before the show starts and I can cross my legs and enjoy, why, “Another Project, Done and Dusted” LOL.</p><p>If you have made it up till this point of my story, I must say, You are also a world changer. Doing it one blogpost at a time. I&#39;m sure you&#39;re wondering where the cup of tea came in, well, Its not a function, just a little motivation… Thank you so much for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c2ab3ce825" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>