# Simple Codes

Arithmetic and Storing Values

Ben Dickins

## Expression

There are three types of expression in R

1. Numbers: 1, 2, 0.2, -5, etc

2. Strings: alphabets or anything that is input by “” into R

3. Logical: `TRUE`

/`FALSE`

## Arithmetic Operators

`x + y`

sum

`x - y`

subtract

`x * y`

multiply

`x / y`

divide

`x ^ y`

power

## Arithmetic Operators

Do it yourself:

## Storing Values

- In all programming languages we can store values in variables and access them later.
- This can be done in various ways using a selection of assignment operators.
- The most commonly used assignment operator is
`<-`

, see the example below:

Note: In most contexts the `=`

operator can be used as an alternative.