Day 2: Load, View Data From a Data Set

Hello 


Before get started on today's concepts, I just want to thank you for being part of this journey.

If you've joined in the last 24 hours, you may not have received older emails. To read those, I've built an archive here

That being said, let's dive right in.

Introducing Data

To perform any sort of data analysis we need... data. Yes. Duh!

But...

We also need data to work on.

Fortunately, we have several data sets we can use within RStudio and one of them - a popular one - is known as Palmer Penguins

It contains body measurements for penguins on three islands in the Palmer Archipelago

If you remember yesterday's lesson on 'Installing Packages', we'll have to do the same to access the Palmer Penguins data set.

Install the package using:

install.packages("palmerpenguins")

and then load the dataset using:

library(palmerpenguins)

Viewing the Data

Now... to view this data, we have a few ways.

You can simply type the word penguins in the console. That's the easiest way.

What you see is what we call 'a tibble'

This is specific to the tidyverse, a package we installed yesterday.

(If this is a new instance of R, remember to load the tidyverse package again)

Another way to view the data 

Using the 'Glimpse' function

In this case, the code will be:

glimpse(penguins)

This will show you all the variables and the first few observations of each variable.

And finally, to view the actual table itself, you can use the 'view' function

In a nutshell, you can view your data set in three ways

  1. Simply type the name of the dataset

  2. Use the glimpse function

  3. Use the view function

It's really that easy

For those of you who missed the mail on how to install and load packages you can refer to it here

That's it for today!

Tomorrow, we'll focus on building a basic graph using this data set.

p.s.

I'd love to know how you're finding the course so far.

Tell me one thing that has been most helpful. I'd love to continue more of it.

Previous
Previous

Day 3 - Time to draw some lines ✍️ (introducing graphs)

Next
Next

Day 1: What's a package and how do you use one?