Question: Based the Dates exercise ( Field , p . 8 8 ) in R , complete this problem either on DataCamp ( use any page
Based the Dates exercise Field p in R complete this problem either on DataCamp use any page of the tutorial or create a new empty workspace or RStudio. Calculate your age in DAYS as of January Keep it simple and only use code that appears on p of the textbook. All you need to accomplish this task are the following lines of code youll need to modify them:
# set the date on which to calculate your age
startingDate asDateYYYYMMDD
# set your birthday
myBirthday
# calculate the difference between the two in YEARS, only using subtraction
difference startingDate myBirthday
# type the name of the variable you've created, which will then call R to print that variable
difference
# Convert your age into YEARS divide by and write a comment to answer the question of how old you are on the specific date in both DAYS and YEARS. Using the asDate function will default a response in days, so provide your answer as a comment with the correct units of measurement.
I will grade your R code by running it in R To receive credit for this question, your code must execute properly with no additional code needed. Try it out before submitting.
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
