Convert days to calendar dates within a data frame in R -


i have dataframe like

id |trtsdt| trtedt 101|17952 | 18037 102|17956 | 18041 

how can convert days date format...thank you

try

df1[-1] <- lapply(df1[-1], as.date, origin='1970-01-01') 

data

df1 <- structure(list(id = 101:102, trtsdt = c(17952l, 17956l), trtedt = c(18037l,  18041l)), .names = c("id", "trtsdt", "trtedt"), class = "data.frame",  row.names = c(na, -2l)) 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -