As a demonstration we will use the `generate_primes()`

function from the `primes`

package. This function takes two numbers as parameters and outputs all prime numbers inside their range.

In order to use a package we first need to load it. This can be done by applying the `library()`

function and inserting the name of the package as the first argument of the function. After that, we have access to all of the content in the package and can use functions from it as usual.

Input

library(primes) generate_primes(min = 500, max = 550)

Output

[1] 503 509 521 523 541 547

Use existing functions and data through packages

- Free exercises and quizzes
- Save your course progress
- Learn new skills

Open as Full Page

Support: support@quantargo.com

2

RecipeIntroduction to VectorsTypes of vectorsQuiz: Data TypesCreating a sequence of numbersExercise: Use the : operatorConcatenating numeric values to a vectorExercise: Concatenate numbersCreating character vectorsExercise: Create a character vectorExercise: Concatenate textCreating logical vectorsExercise: Concatenate logical valuesQuiz: Vectors Recap

4

RecipeUsing R as a pocket calculatorExercise: Use basic arithmeticApplying arithmetic operators on vectorsQuiz: Vector MultiplicationExercise: Multiply numeric vectorsUsing relational operatorsExercise: Compare numeric valuesExercise: Compare temperaturesUsing logical operatorsExercise: Use the & operatorExercise: Use the | operatorUsing the %in% operatorExercise: Use the %in% operator

- Free exercises and quizzes
- Save your course progress
- Learn new skills

Open as Full Page

Support: support@quantargo.com

2

RecipeIntroduction to VectorsTypes of vectorsQuiz: Data TypesCreating a sequence of numbersExercise: Use the : operatorConcatenating numeric values to a vectorExercise: Concatenate numbersCreating character vectorsExercise: Create a character vectorExercise: Concatenate textCreating logical vectorsExercise: Concatenate logical valuesQuiz: Vectors Recap

4

RecipeUsing R as a pocket calculatorExercise: Use basic arithmeticApplying arithmetic operators on vectorsQuiz: Vector MultiplicationExercise: Multiply numeric vectorsUsing relational operatorsExercise: Compare numeric valuesExercise: Compare temperaturesUsing logical operatorsExercise: Use the & operatorExercise: Use the | operatorUsing the %in% operatorExercise: Use the %in% operator

R is everywhere

Not collected

R is everywhere

R is everywhere

Introduction to R

R is everywhere

Quiz: R Facts

R is everywhere

Why Use R?

R is everywhere

Quiz: Using R

R is everywhere

You R in Good Company

R is everywhere

Building Blocks

R is everywhere

Exercise: Submit your first code

R is everywhere

Combine values into a vector

Not collected

Combine values into a vector

Combine values into a vector

Introduction to Vectors

Combine values into a vector

Types of vectors

Combine values into a vector

Quiz: Data Types

Combine values into a vector

Creating a sequence of numbers

Combine values into a vector

Exercise: Use the : operator

Combine values into a vector

Concatenating numeric values to a vector

Combine values into a vector

Exercise: Concatenate numbers

Combine values into a vector

Creating character vectors

Combine values into a vector

Exercise: Create a character vector

Combine values into a vector

Exercise: Concatenate text

Combine values into a vector

Creating logical vectors

Combine values into a vector

Exercise: Concatenate logical values

Combine values into a vector

Quiz: Vectors Recap

Combine values into a vector

Create variables through assignments

Not collected

Create variables through assignments

Create variables through assignments

Assigning variables

Create variables through assignments

Exercise: Assign numeric vector to variable

Create variables through assignments

Exercise: Assign character vector to variable

Create variables through assignments

Quiz: Variable Overriding

Create variables through assignments

Quiz: Vector Concatenation

Create variables through assignments

Naming rules

Create variables through assignments

Quiz: Naming Rules

Create variables through assignments

Use basic operators

Not collected

Use basic operators

Use basic operators

Using R as a pocket calculator

Use basic operators

Exercise: Use basic arithmetic

Use basic operators

Applying arithmetic operators on vectors

Use basic operators

Quiz: Vector Multiplication

Use basic operators

Exercise: Multiply numeric vectors

Use basic operators

Using relational operators

Use basic operators

Exercise: Compare numeric values

Use basic operators

Exercise: Compare temperatures

Use basic operators

Using logical operators

Use basic operators

Exercise: Use the & operator

Use basic operators

Exercise: Use the | operator

Use basic operators

Using the %in% operator

Use basic operators

Exercise: Use the %in% operator

Use basic operators

Call existing R code through functions

Not collected

Call existing R code through functions

Call existing R code through functions

Introduction to functions

Call existing R code through functions

Exercise: Use the sqrt() function

Call existing R code through functions

Customizing functions through parameters

Call existing R code through functions

Exercise: Use the sample() function

Call existing R code through functions

Exercise: Use the seq() function

Call existing R code through functions

Use existing functions and data through packages

Not collected

Use existing functions and data through packages

Use existing functions and data through packages

Introduction to packages

Use existing functions and data through packages

Calling a package

Use existing functions and data through packages

Exercise: Check for leap year

Use existing functions and data through packages

Introduction to R

Go to Course Dashboard

Basics

Badge locked

Table of Contents