I have to work on a data set and create a plot for an example of it that will provide monthly data with a count of orders. On data sets, a date column is created based on the double data type and class of date. I have to split the column based on months. I have to change the data type from double to date. I have tried with as.Date(), as.Date.POSIXct(), and as.Date.POSIXlt(). But I'm unable to change its data type. Could anyone please help me on this issue?
We don't really have enough info to help you out. Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.
If you've never heard of a reprex before, you might want to start by reading this FAQ:
I have to change the type of column data from double to date format. I have tried using functions such as.Date(), as.Date.POSIXct(), and as.Date.POSIXlt(), but I'm unable to change its data type. Could anyone help me with this issue?
I think you want to use class() instead of typeof() because the latter returns the R's internal storage type and dates are stored internally as the number (double) of days since an origin, so, there is no date internal type.