Creating Variables

Learn how to store data values, assign values to variables, understand naming style conventions, and override variable values.


This tutorial will teach you the basics of R. It is not necessary to have any prior programming experience.

Like the previous video which solely focused on the different data types you may come across, this video of the Beginning R Programming series will focus only on variables.

A variable is a way for us to easily store data values or a vector or list of values or a data set or object in R, and allows us to conveniently reference that variable name, saving us from having to rewrite the data value, vector, or object used many times around a program. A variable can only really consist of letters, numbers, periods, underscores, and they must begin with a letter, or a period followed by a letter, not a number.

We’ll cover vectors, main R objects, and reading in datasets later in the video series but we first need to understand how to set up a variable so that we can write these things to a variable name.

To get started watch the video


In the next video, we will study R Operators: Arithmetic, Rational, Logical.