Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Date formats in csv file imported to R

$
0
0

Hello all,
I am very new to R, need your help please.
I have imported a CSV file to Rstudio… telecom complaints register. I have a date variable but the values are in different formats like below.
A= 22/6/2015
B= 6-22-2015
can someone explain me how do I normalize this data?
I have used the below code

callreport$newdate = as.Date(callreport$Date, format = “%d/%m/%Y”)
but this is applying to only format A, for rows with format B it is giving NA

callreport$newdate = as.Date(callreport$Date, format = “%d-%m-%Y”)
but this is applying to only format B, for rows with format A it is giving NA

kindly help

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles