我有一个关于从 R 中的列表中删除非字母数字字符的问题。我有一个列表将包含各种奇数字符、空格等,并希望删除它们。我通常可以使用 r 中的 tm 包删除我想要的内容。我摆弄它,但无处可去,所以认为回到列表可能是开始的地方。
名单:
list("\n \n", "\n\n ", "\n ", " ", "\n ",
"\n \n ", "\n ", "Home", "\n", "Expertise",
"Question & Research Design", "\n", "Survey Development & Validation",
"\n", "Data Processing", "\n", "Statistical Analysis", "\n",
"Publications & Grants", "\n", "Evaluation", "\n", "\n",
"Consulting Areas", "Business", "\n", "Education", "K-12",
"\n", "Â ", " Â Â Â Â", " | ")
预期输出
[1] "" "" ""
[4] "" "" ""
[7] "" "Home" ""
[10] "Expertise" "Question Research Design" ""
[13] "Survey Development Validation" "" "Data Processing"
[16] "" "Statistical Analysis" ""
[19] "Publications Grants" "" "Evaluation"
[22] "" "" "Consulting Areas"
[25] "Business" "" "Education"
[28] "K12" "" ""
[31] "" ""