Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Strings basics
1. Introduction
Regular expressions
Modifying strings
Summary

Instruction

Hi! In this part, we will learn how to work with strings, and how to manipulate them. These skills are necessary for everyday work with R.

Let's begin with something simple: How do you create a string? Just wrap the string in a single (') or double (") quote and assign it to a variable, like so:

string <- "I'm the best!"
string2 <- 'You are the best!'

Note that to include type of quotes in the string, you can wrap the whole string in the other type of quote.

Exercise

Create a string with the contents "I'm learning R now." and assign it to the string variable.