When I write dataframe to the file it considers all columns as characters including the date column.
options(xlsx.date.format = "yyyy-mm-dd")
write.xlsx(data, excel_filename, sheetName = "Data")
How can I write data to xlsx file such that when I work with this column it considered as date by default?
Solution: Turns the class of the column was character. After conversion with as.Date
everything is saved properly.