library(plyr)
library(dplyr)
library(lubridate)
d.in <- read.csv("C:/Users/Person/Documents/dataset.csv")
d.in <- mutate(d.in, dob=mdy(dob))
summary(d.in$dob)
d.in <- mutate(d.in, dob = mdy(dob), hosp_admission = mdy(hosp_admission))
d.in <- mutate(d.in, age_at_admission =
interval(dob,hosp_admission)/dyears(1))
Using this code I get the following message: Warning message: All formats failed to parse. No formats found.
Also, it's changes all of my dates of birth and age at admission to N/A.
dput(head(d.in))
. We cannot reproduce your errors without a data example. Read the SO post on how to create a reproducible example and follow the SO tour. – phiver