# Operators in R

Learn how to use arithmetic and logical operators in R. These binary operators work on vectors, matrices, and scalars.

Mar 2024 · 4 min read

### What's the difference between <- and = for assignment in R?

### Why does 1/3 == 0.3333333 return FALSE in R?

### Can I use && and || for vectorized logical operations?

### How do I check if an element is in a vector or list?

### What does the %% operator do?

### How can I perform integer division in R?

### Why does 2 == "2" return TRUE?

### How do I assign a value globally from within a function?

### Can I create custom operators in R?

### How do I ensure exact comparisons between two objects in R?

RelatedSee MoreSee More

tutorial

### Conditionals and Control Flow in R Tutorial

Learn about relational operators for comparing R objects and logical operators for combining boolean TRUE and FALSE values. You'll also construct conditional statements.

Aditya Sharma

13 min

tutorial

### Matrices in R Tutorial

Learn all about R's matrix, naming rows and columns, accessing elements also with computation like addition, subtraction, multiplication, and division.

Olivia Smith

7 min

tutorial

### Data Types in R

Learn about data types and their importance in a programming language. More specifically, learn how to use various data types like vector, matrices, lists, and dataframes in the R programming language.

Aditya Sharma

12 min

tutorial

### Arrays in R

Learn about Arrays in R, including indexing with examples, along with the creation and addition of matrices and the apply() function.

Olivia Smith

8 min

tutorial

### Utilities in R Tutorial

Learn about several useful functions for data structure manipulation, nested-lists, regular expressions, and working with times and dates in the R programming language.

Aditya Sharma

18 min

tutorial

### Basic Programming Skills in R

Practice basic programming skills in R by using course material from DataCamp's free Model a Quantitative Trading Strategy in R course.

Ryan Sheehy

5 min