[tor-bugs] #24707 [Metrics]: Define R coding guidelines for Metrics' products

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Feb 13 16:45:45 UTC 2018


#24707: Define R coding guidelines for Metrics' products
-------------------------+------------------------------
 Reporter:  iwakeh       |          Owner:  metrics-team
     Type:  enhancement  |         Status:  new
 Priority:  Medium       |      Milestone:
Component:  Metrics      |        Version:
 Severity:  Normal       |     Resolution:
 Keywords:               |  Actual Points:
Parent ID:               |         Points:
 Reviewer:               |        Sponsor:
-------------------------+------------------------------

Comment (by karsten):

 Good idea to define some guidelines. Ideally, we'd even have a checkstyle
 thingy for them.

 Here's a random example from "R for Data Science", which I guess is The R
 Book that we should not ignore:

 {{{
 # Compute rate per 10,000
 table1 %>%
   mutate(rate = cases / population * 10000)

 # Compute cases per year
 table1 %>%
   count(year, wt = cases)

 # Visualise changes over time
 library(ggplot2)
 ggplot(table1, aes(year, cases)) +
   geom_line(aes(group = country), colour = "grey50") +
   geom_point(aes(colour = country))
 }}}

 https://github.com/hadley/r4ds/blob/master/tidy.Rmd

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24707#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list