我有一个数据框
Office 365,MS SQL Server,ASP.NET
Microsoft Azure,ITIL,Project Management
Infrastructure services,AWS solution architect
需要用逗号分隔此单元格,如下所示
Office 365 MS SQL Server ASP.NET
Microsoft Azure ITIL Project Management
Infrastructure services AWS solution architect NA
像这样的东西怎么样dplyr
:
library(dplyr)
df %>% separate(text,c("a","b","c"),sep =",",remove =FALSE) %>% select(-1)
a b c
1 Office 365 MS SQL Server ASP.NET
2 Microsoft Azure ITIL Project Management
3 Infrastructure services AWS solution architect <NA>
由于我们没有您的数据,让我们假设您有一个data.frame
并且您想要一个data.frame
结果:
df <- data.frame(text = c("Office 365,MS SQL Server,ASP.NET",
"Microsoft Azure,ITIL,Project Management",
"Infrastructure services,AWS solution architect"))
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句