[问题类型]:
程式咨询(我想用R 做某件事情,但是我不知道要怎么用R 写出来)
[软件熟悉度]:
入门(写过其他程式,只是对语法不熟悉)
[问题叙述]:
目前我有A、B两个table
我想做一件事是把两个table先join成C,这部分没问题我用merge
之后我想当item字段是空值时把text的资料撷取出部分
text的资料是url类似
utm_source=apple&utm_campaign=PRO&utm_medium=banner&text_id=12228473&date=
970101&loc=65173194cbfdbb89e06742a196ec150f
我想把各别的字串丢进数据库的字段中
例如:
apple 丢进source字段
PRO丢进campaign字段
banner丢进medium字段
65173194cbfdbb89e06742a196ec150f丢进loc字段
但是text_id我没有设字段,所以不需要解析
[程式范例]:
if(C$item == "") {C$apple <- C$text}
我本来是想说先丢进去再拆解,可是我连这个最基础的都ERROR
the condition has length > 1 and only the first element will be used
想问一下这怎么处理
[环境叙述]:
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 LC_CTYPE=Chinese (Traditional)_Taiwan.950
[3] LC_MONETARY=Chinese (Traditional)_Taiwan.950 LC_NUMERIC=C
[5] LC_TIME=Chinese (Traditional)_Taiwan.950
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RPostgreSQL_0.4-1 DBI_0.6
loaded via a namespace (and not attached):
[1] tools_3.3.3
[关键字]:
ETL