Question: Write R codeCreate an additional column in the data frame ( friend ) that results in the total ages for the three persons in each

Write R codeCreate an additional column in the data frame (friend) that results in the total ages for the three persons in each family (= friend + mother + father).
Example code:
# Convert character value to numeric to add
frienddf$age <- as.numeric(as.character(frienddf$age))
frienddf$momAge <- as.numeric(as.character(frienddf$momAge))
frienddf$dadAge <- as.numeric(as.character(frienddf$dadAge))
# Add a column for total age
frienddf$totalAge <- frienddf$age + frienddf$momAge + frienddf$dadAge

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 Databases Questions!