Replacing all semicolons with a space pt2

前端 未结 2 895
生来不讨喜
生来不讨喜 2021-01-25 22:28

Im trying to run text analysis on a list of 2000+ rows of keywords, but they are listed like

\"Strategy;Management Styles;Organizations\"

So when I use tm to re

2条回答
  •  广开言路
    2021-01-25 23:20

    Maybe you can try strsplit

    X <- c("Global Mindset;Management","Auditor;Accounting;Selection Process","segmantation;banks;franchising")
    res <- Map(function(v) unlist(strsplit(v,";")),X)
    

    such that

    > res
    $`Global Mindset;Management`
    [1] "Global Mindset" "Management"    
    
    $`Auditor;Accounting;Selection Process`
    [1] "Auditor"           "Accounting"        "Selection Process"
    
    $`segmantation;banks;franchising`
    [1] "segmantation" "banks"        "franchising" 
    

提交回复
热议问题