[1] 5
POP88162 Introduction to Quantitative Research Methods
Department of Political Science, Trinity College Dublin
Key operators in R are:
+, -, *, ^, /, %/%, %%, %*%)&, &&, |, ||, !)==, !=, >, >=, <, <=)<-, <<-, =)%in%)Arithmetic operations in R:
\(5^2 = 5 \times 5 = 25\)
\(5^{-2} = \frac{1}{5^2} = \frac{1}{5 \times 5} = \frac{1}{25} = 0.04\)
\(5 \times 10^{-2} = 5 \times \frac{1}{10^2} = 5 \times \frac{1}{100} = \frac{5}{100} = 0.05\)
\(5 \times 10^{-3} = \frac{5}{1000} = 0.005\)
\(5 \times 10^{-4} = \frac{5}{10000} = 0.0005\)
Everything that exists in R is an object.
John Chambers
<- is the standard assignment operator in R.= is also supported it is not recommended..R extension and contains a collection of valid R commands..md file extension..Rmd file extension_ or * for emphasis (single - italic, double - bold, triple - bold and italic)
*one* becomes one, __two__ - two and ***three*** - three#, ##, ###, #### and so on-, + or *
1. (counter is auto-incremented)[some text here](url_here)R Markdown
Rendering
### Title
Some text in *italic* and **bold**
Simple list:
- A
- B
Ordered list:
1. A
1. B
Example, where $Y_i = 5 + X_i + \epsilon$
```{r}
x_i <- 3
epsilon <- rnorm(1)
y_i <- 5 + x_i + epsilon
y_i
```