【发布时间】:2018-04-23 11:03:15
【问题描述】:
我有数据集。
v1 <- c("I will try to fix you usman@usman.com", "I will try to fix you", "Zombies Zombies xyz@ymail.com")
v2 < c("ABC", "XYZ", "Oh Game")
dx <- data.frame(v1, v2)
我使用
从v1 提取电子邮件
regmatches(dx$v1, regexpr("[[:alnum:]]+\\@[[:alpha:]]+\\.com", dx$v1))
这行得通。
我只想将电子邮件与v2 相邻放在dx 中
这样。
ABC usman@usman.com
XYZ NA
Oh Game xyz@ymail.com
看起来很基本,但我无法弄清楚。
【问题讨论】: