Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Data Types | Data Types and Vectors
R Introduction

bookData Types

Note
Definition

A data type defines what kind of values a variable can store and which operations are valid. It determines how data is represented in memory and how R interprets and manipulates it.

Common Data Types

Inspecting Data Types

Use the typeof() function to check a variable's data type.

Example

1234567891011
x = TRUE typeof(x) y = 42L typeof(y) z = "hello" typeof(z) w = 3.14 typeof(w)
copy
Task

Swipe to start coding

  1. Assign the number 10 to a variable named chapter.
  2. Display the data type of the chapter variable.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 1
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

What does the output of the typeof() function look like?

Can you explain the difference between double and integer types?

How do I convert between these data types in R?

close

Awesome!

Completion rate improved to 2.27

bookData Types

Swipe to show menu

Note
Definition

A data type defines what kind of values a variable can store and which operations are valid. It determines how data is represented in memory and how R interprets and manipulates it.

Common Data Types

Inspecting Data Types

Use the typeof() function to check a variable's data type.

Example

1234567891011
x = TRUE typeof(x) y = 42L typeof(y) z = "hello" typeof(z) w = 3.14 typeof(w)
copy
Task

Swipe to start coding

  1. Assign the number 10 to a variable named chapter.
  2. Display the data type of the chapter variable.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 1
single

single

some-alt