The purpose of this required peer review assignment is to perform basic R code practice and use lubridate package in R Notebook as per the attached instruction.
1. Create a new markdown file by selecting either R Notebook or R Markdown from the dropdown menu in the top, left-hand corner of RStudio. Please name it using the following convention: mod3_peer_review_your first name_your last name.RMD.
2. Add a heading in the notebook to mention the course name, “Introduction to Business Analytics with R.” (5%)
3. Use a code chunk to create a datetime object d from the following character string that represents May 8, 2020: “05/08/2020”. Only use base R. Do not use functions from the lubridate package. (15 %)
4. Use a new code chunk to check the data type of the d object by printing it. If it is in a date format, then it will show up as “2020-05-08”. (5 %)
5. If necessary, install the lubridate package using the Package pane in RStudio. In a new code chunk, load the lubridate package. (5 %)
6. In a new code chunk, use the appropriate functions from the lubridate package to extract the year, month number, week number and weekday number from the object d created above. Save them as objects name d_year, d_month, d_week, and d_day respectively. Include code to display each of the four objects. (30 %)
7. Use a new code chunk to create another datetime object, d_25, using the object d, where d_25 is the date 25 days from now. Include code to display d_25.(15 %)
8. Finally, use a new code chunk to calculate and display the difference between d and d_25 using the difftime function and check whether the difference is 25 days. (10%)
9. For steps 3 through 8, please add some text before each code chunk to explain the purpose of the code chunk as briefly as possible. Please do not use more than three sentences for each explanation. (15%)
10. Knit the .rmd notebook file to an HTML file and submit the HTML file for peer review. Name the HTML file as mod3_peer_review_your first name_your last name.html.