I'm trying to convert a column in a table from integer to date with ymd().
The table is large one creating from merging several csv. The table structure is as follows:
Classes ‘data.table’ and 'data.frame': 49229 obs. of 46 variables:
PEP : chr
PN_Oper_M : chr
Desig_Oper_M : chr
Refer_M : int
Estado_M : chr
Conc_SAP : chr
Inc_SAP : chr
Conc_SICAP : chr
Incu_SICAP : chr
Avance : chr
Quemado : chr
RTD : chr
F_Ini_Plan_ : int 20200303 20201021 20210211 20210211 20210211...
F_Fin_Plan_ : int 20200424 20201021 20210211 20210211 20210211...
F_Cie_Plan_ : int 20200430 20201027 20210217 20210217 20210217...
Grupos : chr
Localiza : chr
Zona : chr
AG : chr
GNTs : chr
Empresas : chr
Hitos : chr
Req_Pdtes : int
Falta : int
CADO : chr
UDC : chr
New : int
Estr : int
N_HNC : chr
F_Libe_R_ : int 20191211 20200727 20201202 20201202 20201202...
F_Ini_R_ : int 20200303 20210308 20210216 20210204 20210218...
F_CERR_ : int 20200430 20210323 20210305 20210305 20210316...
F_Fin_Prod_ : int 20200424 20210316 20210216 20210204 20210218...
F_Fin_Cal_ : int 20200429 20210318 20210222 20210204 20210313...
Est_SICAP : chr
Est_SIPLA : chr
ZPLA : int
ZING : int
Comentarios : chr
IntExt : chr
Perfil : chr
H_Planif : chr
DOP_DI_Number : chr
DOP_DI_Status : chr
DOP_DI_Ubicacion: chr
Manual_JC : int
- attr(*, ".internal.selfref")=<externalptr>
All dates are merged as integer and I want to convert them into date. I have two questions:
- I extract one of the columns and try to convert it with ymd() using the following code:
d1 <- all[ , 30]
d1 <- ymd(d1)
But I get the following error:
"Warning message:
All formats failed to parse. No formats found."
There are empty values, could it be the problem?
- Is there a quick way to convert several columns format?? The dataframe has no headers so I have to do it calling the column position.
Many thanks Hugo