Question: Write Code in R Create a data frame ( named friend ) that includes following variables. # name consists of four friends' names # age
Write Code in R
Create a data frame named friend that includes following variables.
# name consists of four friends' names
# age consists of their ages
# momAge consists of their mothers' ages You can make up the age
# dadAge consists of their fathers' ages You can make up the age Example code:
# Create vectors
name cLucy "Junga", "Mike", "Jason"
age c
momAge c
dadAge c
# Cbind the vectors
friend cbindname age, momAge, dadAge
# Convert to a data frame
frienddf asdata.framefriend
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
