Hello Experts,
I am learning R. In one of the online learning courses, I came across the following exercise that I solved, however, Katacoda web platform says the result is NOT correct. I wanted to double-check if I am missing something.
Problem:
Consider a data frame strDates having values 01/05/1965, 08/16/1975. Convert this to different date formats like month/date/year, year-month-date.
My Code:
dts <- c("01/05/1965", "08/16/1975")
strDates <- data.frame (dts)
dts1 <- format (as.Date(strDates$dts, format="%m/%d/%Y"), "%m/%d/%Y")
dts2 <- format (as.Date(strDates$dts, format="%m/%d/%Y"), "%Y-%m-%d")
strDates <- data.frame (dts1)
strDates
strDates <- data.frame (dts2)
strDates
Online Course: FrecoPlay (TCS) Lesson: Data Cleansing Using R, Platform: Katacoda
#Homework