简体   繁体   中英

How to insert special character in a numerical value in R

my object is x <- 20140323 i want to change extract it like this 2014-03-23 how can i change it I tried following code

 1. z1 <- 20141103  z1[1[1]]   id <-1  z2 <-   
    numeric(length(z1)+length(id))  z2[id] <- "-"  z2[!is.na(z2)] <- z1

      View(z2) v[3,extrat="true"] <- "-"
as.Date(as.character(x), "%Y%m%d")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM