_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › String豌襴

Contents

1 str_replace
2 format
3 01,02,03.. 襦 襷り鍵
4 vector to string
5 讌 蟯
6 string split


1 str_replace #

library(stringr)
colnames(gender) <- str_replace(colnames(gender), "\.", " ")

3 01,02,03.. 襦 襷り鍵 #

library("stringr")
> str_sub(paste0("00", 1:10), -2, -1)
 [1] "01" "02" "03" "04" "05" "06" "07" "08" "09" "10"

4 vector to string #

a <- c("aa", "bb", "cc")
paste(a,collapse="")

5 讌 蟯 #

date to character
strftime(as.Date("2013-12-01"))

yyyymmdd <- xpathSApply(doc,"//div[@class='filter-item' and @control-filter='daily']//a[@class='current']", xmlValue)
generate_time <- xpathSApply(doc,"//div[@class='generate-time' and @data-meta='generate-time']//b", xmlValue)
Sys.setlocale("LC_TIME","English")
#"Jul 23, 2014 10:00am UTC+9"
crawling_time <- strptime(paste(yyyymmdd, generate_time), "%b %d, %Y %I:%M%p", tz="")
std_dt <- substr(crawling_time,1,10)
Sys.setlocale("LC_TIME","Korean_Korea.949")

6 string split #

s <- c("a", "b", "c")
v <- unique(tolower(strsplit(s, ",")))
paste(v, collapse=',')

(csv <- paste(as.character(1:5), collapse=", "))
unlist(strsplit(csv, ","))
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:52

覲企 蟆讀 蟯 企.