# R Programing

## R Programing

﻿What's that data type?
100xp
Do you remember that when you added 5 + "six", you got an error due to a mismatch in data types? You can avoid such embarrassing situations by checking the data type of a variable beforehand. You can do this with the class()function, as the code on the right shows.
Instructions
Complete the code in the editor and also print out the classes of my_character and my_logical.
Arithmetic with R
100xp
In its most basic form, R can be used as a simple calculator. Consider the following arithmetic operators:
Subtraction: -
Multiplication: *
Division: /
Exponentiation: ^
Modulo: %%
The last two might need some explaining: - The ^ operator raises the number to its left to the power of the number to its right: for example 3^2is 9. - The modulo returns the remainder of the division of the number to the left by the number on its right, for example 5 modulo 3 or 5 %% 3 is 2.
With this knowledge, follow the instructions below to complete the exercise.
Instructions
Type 2^5 in the editor to calculate 2 to the power 5.
Type 28 %% 6 to calculate 28 modulo 6.
Click 'Submit Answer' and have a look at the R output in the console.