Question: ## Exercise 1 : Create Vectors Create three vectors in the R code chunk below containing information about your family. vector 1 : title this

## Exercise 1: Create Vectors
Create three vectors in the R code chunk below containing information about your family.
vector 1: title this vector "name". Create a character vector containing the names of you and your immediate family members. (This can be totally fictional if you aren't comfortable with including real information.)
vector 2: title this vector "age". Create a numeric vector containing the respective ages (in years) of each family member listed in the vector name.
vector 3: title this vector "female". Create a logical vector that indicates whether each respective family member is female (true/false)
```{r vectors}
```
## Exercise 2: Vector Exploration
In the R chunk below, write R script that will do the following:
1. Identify the length of the name vector you created.
2. Identify the number of characters in each name.
```{r vector exploration}
```
## Exercise 3: Data frames
In the code chunk below create a data frame titled "myfamily" that consists of the three vectors you created in Exercise 1. Write a script that examines the structure of the data frame.
```{r dataframe}
```
## Exercise 4: Indexing
In the code chunk below write script that identifies the following data from your data frame:
1. family members over the age of 18.
2. family members that are male.
3. the second column of your data frame.
4. The entry in column 3 row 1.
```{r indexing}
```
## Excercise 5: Create a New Column
Write a script that adds a column "Adult" to the data set. This column should have entries With "Yes" corresponding to family members over the age of 18 and "No" for family members under the age of 18.
```{r newcolumn}
```
## Exercise 6: Make column a factor
One important skill when learning to work with any scripting language is to be able to find script to adapt on the internet.
Search the web for script to convert a character vector to a factor.
What resource did you find useful?
(copy/past a link here)
What is the use of a factor data type?
(type your answer here)
In the code chunk below to convert the "Adult" variable to a factor.
Include script to examine the structure of your data frame.
```{r factor}
```

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!