Track organization progress
Source:vignettes/articles/track-organization-progress.Rmd
track-organization-progress.Rmd
Organizations can accumulate many users, projects, labels and answers. Keeping track of organization activity can be a real challenge. Here is a simple approach to tracking organization activity.
Get Sysrevs
rsr::get_sysrevs
gets all of the sysrevs for a given organization.
sysrevs <- rsr::get_sysrevs("Ontox")
sysrevs |> arrange(desc(date_created))
#> # A tibble: 40 × 3
#> project_id name roles
#> <int> <chr> <list>
#> 1 90507 PAUSED: Master Screening Labels <df [61 × 3]>
#> 2 90518 PAUSED: ONTOX Exploration - Screen & Sort <df [63 × 3]>
#> # … with 38 more rows
The first project above can be found at (sysrev.com/p/77703). The project names, creation dates, and roles are available.
Roles
Project administrators can be discovered by unnesting the roles column.
sysrevs |> unnest(roles) |> filter(role=="admin")
#> # A tibble: 407 × 4
#> project_id name username role
#> <int> <chr> <chr> <chr>
#> 1 90507 PAUSED: Master Screening Labels TJ-Toxtrack admin
#> 2 90507 PAUSED: Master Screening Labels bot admin
#> # … with 405 more rows
Labeling activity
How active are the different projects? get_answers
gets a projects answers. Run it on every project to get all organization answers. The p.answers
function below guarantees that this section will run, even if get_answers breaks for some specific project.
p.answers <- possibly(rsr::get_answers,otherwise = tibble())
sr.answers <- sysrevs |>
select(project_id,name) |>
mutate(answers = map(project_id,p.answers)) |>
unnest(answers)
#> # A tibble: 156,202 × 14
#> project_id name aid title lid user_id confi…¹ resolve short…² value…³
#> <int> <chr> <int> <chr> <chr> <int> <chr> <lgl> <chr> <chr>
#> 1 90507 PAUSED:… 1.21e7 Stem… 7cf3… 1668 2021-0… FALSE Species catego…
#> 2 90507 PAUSED:… 1.21e7 Stem… 8359… 1668 2021-0… FALSE Review? boolean
#> # … with 156,200 more rows, 4 more variables: answer <chr>, opts <list>,
#> # pid <int>, resolve_time <chr>, and abbreviated variable names
#> # ¹confirm_time, ²short_label, ³value_type
Labels
A table collecting all the labels and their usage can be generated:
labels = map_dfr(sysrevs$project_id,rsr::get_labels)