删除标点但保留主题标签

时间:2014-04-13 18:39:45

标签: r

我可以使用gsub删除标点符号但保留标签“#”不被删除吗?

Data_edited_txt <- gsub("[[:punct:]]", "", Data_edited_txt)

structure(list(text = structure(c(4L, 6L, 1L, 2L, 5L, 3L), .Label = c("#AirAsia @AirAsiaId finally they let us fly with 9.20 flight today. Manual boarding pass. Phew, that was a #great relief!", 
"@AirAsia your direct debit (Maybank) payment gateways is not working. Is it something you are working to fix?", 
"RT @AirAsia: Kindly note that CIMB Direct Debit service will be unavailable tonight from (GMT+8) 1145hrs on 31 Jan until 0600hrs on 3 Feb 2…", 
"RT @AirAsia: Skipped breakfast this morning? Now you can enjoy a #great breakfast onboard with our new breakfast meals! http://t.co/957ZaLjY…", 
"xdek ke flight @AirAsia Malaysia to LA... hahah..bagi la promo murah2 sikit, kompom aku beli...", 
"You know there is a problem when customer service asks you to wait for 103 minutes and your no is 42 in the queue. #AirAsia"
), class = "factor"), created = structure(c(5L, 4L, 4L, 3L, 2L, 
1L), .Label = c("1/2/2014 16:14", "1/2/2014 17:00", "3/2/2014 0:54", 
"3/2/2014 0:58", "3/2/2014 1:28"), class = "factor")), .Names = c("text", 
"created"), class = "data.frame", row.names = c(NA, -6L))

0 个答案:

没有答案
相关问题