6

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.

Psidom
  • 209,562
  • 33
  • 339
  • 356
Adeel Sarwar
  • 61
  • 1
  • 2
  • 1
    Shouldn't it be something like `read_csv(filename, col_types=cols(col_date("%d/%m/%Y"), col_double(), ...))`. See [Column Types vignette](https://cran.r-project.org/web/packages/readr/vignettes/column-types.html). – r2evans Jul 01 '16 at 01:44
  • Yes that worked, the mistake i was making, i was giving two inputs: one from column and one inside col_date function. Thanks a lot for your help – Adeel Sarwar Jul 01 '16 at 02:34

1 Answers1

5

Building on comments, it should be something like:

read_csv(filename, col_types=cols(column-name = col_date("%d/%m/%Y"))
JelenaČuklina
  • 3,574
  • 2
  • 22
  • 35