Convert Date to Character or Remove

I have a dataframe d (read from an RDS or Excel file):

ID Date
1 1990-01-02
2 1990-01-03
3 1990-01-04

and cannot remove the date column through this code:

d <- d %>% select(where(function(x) !is.Date(x)))

and cannot change the format to character through this code:

d <- d %>% mutate(across(where(is.Date), as.character))

in both cases the print(str(d)) pre and post processing still retains the date column as is:

$ Date : POSIXct, format: "1990-01-02" "1990-01-03" "1990-01-04" "1990-01-05" ...

I am simply trying to remove or reformat the date column. How can I do this through tidyverse?

POSIXct is not recognised by lubridate's implementation of is.Date()

 d %>% select(where(\(x) !is.POSIXct(x)))

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.