我有一個數據幀刪除特殊字符和數字中的列:在數據幀
dput(Data1)
structure(list(Emp.ID = c(182038L, 191854L), Project.Acquired.Skill = structure(c(2L,
1L), .Label = c("Architecting (10),Cognos TM1 (4),Support Function (3)",
"SAS (76),SAS Analytics (76),SAS BI (76),SAS data modeling tool (63),ClearCase (18),SQL (18),SQL Server (18),SQL SERVER 2000 (18),SQL SERVER 2005 (18),Excel (16),Oracle (16),AS400 (10)"
), class = "factor")), .Names = c("Emp.ID", "Project.Acquired.Skill"
), class = "data.frame", row.names = c(NA, -2L))
str(Data1)
'data.frame': 2 obs. of 2 variables:
$ Emp.ID : int 182038 191854
$ Project.Acquired.Skill: Factor w/ 2 levels "Architecting (10),Cognos TM1 (4),Support Function (3)",..: 2 1
我有一個列這與這樣Architecting (10),Cognos TM1 (4),Support Function (3)
值的一個因素,我需要剝除數字(0 -9),WhiteSpace和括號()得到Architecting,Cognos TM1,Support Function
。我正在面臨的問題,因爲這是編碼爲因素。
我的輸出應該是這樣的
Emp ID Project Acquired Skill
182038 SAS,SAS Analytics,SAS BI,SAS data modeling tool,ClearCase,SQL,SQL Server,SQL SERVER 2000,SQL SERVER 2005,Excel,Oracle,AS400
191854 Architecting,Cognos TM1,Support Function