Get startedGet started for free

Load a data set into R

Let's start by reading in the data set. You will work with the present data set: http://assets.datacamp.com/course/dasi/present.txt. The present data set refers to the number of male and female births in the United States. It contains the data for all of the years from 1940 to 2002.

Use the function read.table() to read in the data. Because you are accessing data from the web, this command (and the entire analysis) will work in a computer lab, in the library, or in your dorm room; anywhere you have access to the Internet. This is of course very powerful when working in a team or on different devices.

This exercise is part of the course

Data Analysis and Statistical Inference

View Course

Exercise instructions

Load in the present data set with the help of the read.table() function and assign the result to the object present. Your code should look something like: read.table("dataset_url"). Use the quotes " to tell R the provided url is a string (a sequence of characters) and not an object.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Read in your data set and assign to the object:
present <- ___

# This will print your data set in the console:
present
Edit and Run Code