Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F47901
ve_query.R
Ironholds (Oliver Keyes)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Ironholds
Feb 26 2015, 5:43 PM
2015-02-26 17:43:42 (UTC+0)
Size
1017 B
Referenced Files
None
Subscribers
None
ve_query.R
View Options
library
(
WMUtils
)
data
<-
global_query
(
"SELECT rev_user_text, COUNT(*) AS edits, MAX(rev_timestamp) AS recent_edit
FROM revision INNER JOIN tag_summary
ON ts_rev_id = rev_id
WHERE rev_timestamp >= '20141125203901'
AND rev_user > 0
AND ts_tags RLIKE('visual')
GROUP BY rev_user_text;"
)
data
$
recent_edit
<-
as.numeric
(
data
$
recent_edit
)
aggregated_data
<-
data
[,
j
=
{
if
(
length
(
recent_edit
[
recent_edit
>
20150126000000
])
==
0
){
NULL
}
else
{
projects
<-
table
(
project
)
home_wiki
<-
names
(
projects
)[
projects
==
max
(
projects
)][
1
]
output
<-
data.table
(
edits
=
sum
(
edits
),
home_wiki
=
home_wiki
)
output
}
},
by
=
"rev_user_text"
]
setnames
(
aggregated_data
,
1
,
"username"
)
aggregated_data
<-
aggregated_data
[
order
(
aggregated_data
$
edits
,
decreasing
=
TRUE
),]
write.table
(
aggregated_data
[
1
:
500
,],
"top_ve_editors.tsv"
,
row.names
=
FALSE
,
quote
=
TRUE
,
sep
=
"\t"
)
File Metadata
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
45779
Default Alt Text
ve_query.R (1017 B)
Attached To
Mode
T90641: Most-active VisualEditor users
Attached
Detach File
Event Timeline
Log In to Comment