Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

readr - Importing date column in CSV

Tags:

r

readr

I need an advice as to how import data using readr by inputing my own date format The way i am trying is:

read_csv("test", col_types = cols( column-name = col_date("02/03/2015", "%d/%m/%Y))

But its giving me error

" Error in col_date("02/03/2015", "%d/%m/%Y"): unused argument("%d/%m/%Y")

When i test a single input using parse_date("02/03/2015", "%d/%m/%Y") it gives me the desired results

I would really appreciate if someone will help me, got stuck on this for last couple of days.

like image 953
Adeel Sarwar Avatar asked Oct 31 '22 00:10

Adeel Sarwar


1 Answers

Building on comments, it should be something like:

read_csv(filename, col_types=cols(column-name = col_date("%d/%m/%Y"))
like image 108
JelenaČuklina Avatar answered Nov 15 '22 05:11

JelenaČuklina