I did the following code to import a excel file in Rstudio:
(nms <- names(read_excel("myexcelfile.xlsx")))
(ct <- ifelse(grepl("^Date", nms), "text", "numeric"))
read_excel("myexcelfile.xlsx", col_types = ct)[-c(6:495),-c(3:71)]
The resul is this dataframe below:
structure(list(Data = c("41731", "41730", "41729", "41726", "41725"
), ABEV3 = c(15.2, 14.9, 15.22, 15.15, 15.18)), row.names = c(NA,
-5L), class = c("tbl_df", "tbl", "data.frame"))
The first column should be the dates (Brazilian Format: Day/Month/Year).
How can I fix this?
