Convert data to numeric and remove decimals

Wed Jun 01 2022 11:18:43 GMT+0000 (Coordinated Universal Time)

Saved by @Treenose #r

df %>%
  # theoretical_age: age of person based on birth
  mutate(theoretical_age = floor(as.numeric(birth %--% today(), "years"))) # get age in whole years
  
  # Define the date formats
formats <- c("%Y-%m-%d", "%B %d, %Y")

# Convert dates to the same format
df %>%
  mutate(date_column_cleaned = parse_date_time(date_column, formats)) 
content_copyCOPY