---
title: "Class 9"
author: "Andrés Aravena"
number: 041234566
date: "October 15, 2018"
output: html_document
---

# Load data
```{r}
survey <- read.table("survey1-tidy.txt")
colnames(survey)
```

# Weight
we choose one column
```{r}
survey$weight_kg
```

# light people
this is a logic vector
```{r}
survey$weight_kg < 50
```

we use the logic vector as row index
```{r}
survey[survey$weight_kg < 50, ]
```

what is the height of people less than 50 kg
```{r}
survey[survey$weight_kg < 50, "height_cm"]
```

# combining conditions
people between 50 and 70 kg
```{r}
survey[survey$weight_kg >= 50 & survey$weight_kg <=70, ]
```

what is the hand span of "Male" and "Left handed"?

```{r}
survey[survey$Gender=="Male" & survey$handness=="Left", "hand_span_cm"]
```

left hand male heavier than 70
```{r}
survey[survey$weight_kg>70 & survey$handness=="Left" &   survey$Gender=="Male", "hand_span_cm"]
```

# everybody except the first 10
```{r}
survey[-(1:10),]
```

assign
```{r}
aziz <- survey[-(1:10),]
aziz[aziz$weight_kg>=50 & aziz$weight_kg<=70, "weight_kg"]
```





send to **andres.aravena+cmb@istanbul.edu.tr**
