Question: ## Exercise 1 : Create Vectors Create three vectors in the R code chunk below containing information about your family. vector 1 : title this
## Exercise : Create Vectors
Create three vectors in the R code chunk below containing information about your family.
vector : 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 : title this vector "age". Create a numeric vector containing the respective ages in years of each family member listed in the vector name.
vector : title this vector "female". Create a logical vector that indicates whether each respective family member is female truefalse
r vectors
## Exercise : Vector Exploration
In the R chunk below, write R script that will do the following:
Identify the length of the name vector you created.
Identify the number of characters in each name.
r vector exploration
## Exercise : Data frames
In the code chunk below create a data frame titled "myfamily" that consists of the three vectors you created in Exercise Write a script that examines the structure of the data frame.
r dataframe
## Exercise : Indexing
In the code chunk below write script that identifies the following data from your data frame:
family members over the age of
family members that are male.
the second column of your data frame.
The entry in column row
r indexing
## Excercise : 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 and No for family members under the age of
r newcolumn
## Exercise : 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?
copypast 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
