---
title: "Lab 1: Practice Code"
author: "Your name"
output:
  pdf_document: default
editor_options:
  chunk_output_type: console
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# Prerequiste
```{r, message=FALSE}
rm(list = ls()) # Clear memory

library(tidyverse) # Load package
```


# Vector Practice
1. `Vector1` : The numbers one through five and then the number six five times
2. `Vector2` : 10 randomly drawn numbers from a normal distribution with a mean 10 and a sd of 1
3. `Vector3` : Results of 10 single binomial trials with a probability of 0.4
4. `Vector4` : Sample 100 observations from a 5-trial binomial distribution with a probability of success of 0.4
5. `Vector5` : The numbers one through three and the word apple
```{r}

```

6. What type of data is Vector2?
7. Round up Vector2 to two decimal place
8. What happened in Vector5?
```{r}


```


# Matrices Practice
1. Matrix1: Create 5 by 5 matrix containing all NAs 
2. Assign Matrix1 the row names (a,b,c,d,e) and the column names (1,2,3,4,5)
3. Replace the NAs in the first columne of Matrix1 with "Inf"
```{r}

```


# List Practice
1. Create a list that contains Vector1, Vector2, Vector3, and Matrix1
2. Name each list component as Vector1, Vector2, Vector3, and Matrix1 respectively
3. Locate Vector2 from the list
```{r}

```

# Data Frames Practice 1
## 1. Load Lab1_data.csv in R
```{r}
# Load data in simple way


```

## 2. What is the data structure? What does that tell us about type?
```{r}
# Check structure  

```

## 3. Check the names and summary statistics of the data. Fix any names that are less than good.
```{r}
# Check and fix names



```

## 4. Remove observations with missing values
```{r}



```

## 5. Calculate the average GDP per capita for Brazil for the observed period. Repeat the calculation for all countries.
```{r}


```

## 6. Plot GDP per capita (on the x-axis) and Polity2 (on the y-axis)
```{r}

```

## 7. Create a new variable called "democracy". Assign 0 to countries with negative value or zero polity2 score, and assign 1 to countries with positive score.
```{r}

```

## 8. Export (save) the data set with the new variable "democracy" both as .csv and .rdata files
```{r}

```


