[問題] 在R中有處理http query string
[問題類型]:
程式諮詢(我想用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
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 211.23.167.43
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1496998981.A.87C.html
→
06/09 18:00, , 1F
06/09 18:00, 1F
→
06/09 18:01, , 2F
06/09 18:01, 2F
→
06/09 18:19, , 3F
06/09 18:19, 3F
→
06/09 18:20, , 4F
06/09 18:20, 4F
推
06/13 12:44, , 5F
06/13 12:44, 5F
推
06/13 18:37, , 6F
06/13 18:37, 6F
→
06/13 18:44, , 7F
06/13 18:44, 7F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 3 篇):