我制作了自己的路由器,所以我需要匹配或从网址获取数据
library(data.table)
setDT(dataset1)[CJ(bnames=bnames, events=events, unique=TRUE),
.(freq=ifelse(is.na(freq), 0, freq)),
by=.EACHI,
on=.(bnames, events)]
# bnames events freq
#1: T1 I 1
#2: T1 O 2
#3: T2 I 3
#4: T2 O 0
#5: T3 I 4
#6: T3 O 5
我可以在哪里匹配或从(。*)获取数据?
这样的router(array('GET', 'OPTIONS'), '^/player/check/(.*)$', function() {
// Enable CORS
enableCORS();
header('Content-Type: application/json');
echo 'asd';
});
?