我有一個字符向量(VEC)是這樣的:分裂開字符向量爲單個單詞中的R
[1] "super good dental associates" "cheap dentist in bel air md"
"dentures " "dentures "
"in office teeth whitening" "in office teeth whitening"
"dental gum surgery bel air, md"
[8] "dental implants" "dental implants"
"veneer teeth pictures"
我需要分開打破這種爲個體話。我嘗試這樣做:
singleWords <- strsplit(vec, ' ')[[1]]
,但是,我只得到該向量的第一個元素上分割:
[1] "super" "good" "dental" "associates"
我怎樣才能獲得的所有單詞作爲單個元件的單一載體?
嘗試'sapply通話(VEC, strsplit,「」)',你可以用'unlist'包裝它,如果你想要它們在一個向量中 –
這不是拆分單個詞:( – Cybernetic
我添加了一個例子使用'sapply' –