I am working with data in R
that I imported form excel
format.
I have a column (isas1_3b
) in the dataframe (LPAv1.1.1
) which is in the character
format. Upon importing, the dates have changed from the format dd/mm/yy, to days (e.g., 41268).
I have tried to convert this as below:
as.Date(LPAv1.1.1$isas1_3b, origin = "1899-12-30")
However, I get the following error:
Error in charToDate(x) : character string is not in a standard unambiguous format 4. stop("character string is not in a standard unambiguous format") 3. charToDate(x) 2. as.Date.character(LPAv1.1.1$isas1_3b, origin = "1899-12-30") 1. as.Date(LPAv1.1.1$isas1_3b, origin = "1899-12-30")
I'm not sure what I am doing wrong. After numerous searches, the above conversion is what was recommended.
I should also add, that there are two other date columns in the original excel
document. But they have both been read in as 'POSIXct''POSIXt'
.
Other info that may be relevant:
macOS 13.13.3 R 3.3.3 RStudio 1.1.419
Can someone please help resolve this issue... I am assuming it is something that I am doing. Please let me know if you need any more info.
isas1_3b
column is not numeric, it's a character column currently. Convert it usingas.numeric
first and then try again. – thelatemail