[tor-bugs] #25382 [Metrics/Website]: Make all graph data available as CSV

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Feb 28 16:26:49 UTC 2018


#25382: Make all graph data available as CSV
-----------------------------+------------------------------
 Reporter:  karsten          |          Owner:  karsten
     Type:  enhancement      |         Status:  needs_review
 Priority:  Medium           |      Milestone:
Component:  Metrics/Website  |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:                   |  Actual Points:
Parent ID:                   |         Points:
 Reviewer:  iwakeh           |        Sponsor:
-----------------------------+------------------------------

Comment (by iwakeh):

 Replying to [comment:7 karsten]:
 > The suggestion there looks like a fine start. Without going into the
 details yet,
 >  - we'll have to see how to generate those lines in R using `write.csv`
 and

 We need to use `write.table`, for example:

 {{{
 ## the data summary
 summary(y)
          date        users       downturns        upturns            lower
 upper
  2018-01-01: 1   Min.   :716.0   Mode :logical   Mode :logical   Min.
 :165.0   Min.   :1039
  2018-01-02: 1   1st Qu.:755.0   FALSE:58        FALSE:58        1st
 Qu.:403.5   1st Qu.:1106
  2018-01-03: 1   Median :780.0                                   Median
 :455.0   Median :1173
  2018-01-04: 1   Mean   :778.9                                   Mean
 :444.1   Mean   :1179
  2018-01-05: 1   3rd Qu.:802.5                                   3rd
 Qu.:496.2   3rd Qu.:1225
  2018-01-06: 1   Max.   :858.0                                   Max.
 :593.0   Max.   :1584
  (Other)   :52


 # writing
 write("# some comments", file="data.csv")
 write("# some more comments", file="data.csv", append = TRUE)
 write.table(y, file="data.csv", append = TRUE, quote=FALSE, sep=",",
 row.names = FALSE)
 }}}

 Yields:
 {{{
 # some comments
 # some more comments
 date,users,downturns,upturns,lower,upper
 2018-01-01,787,FALSE,FALSE,369,1319
 2018-01-02,754,FALSE,FALSE,427,1268
 2018-01-03,791,FALSE,FALSE,485,1107
 2018-01-04,823,FALSE,FALSE,452,1119
 ...
 }}}

 >  - we'll be able to re-use quite some content from the current
 stats.html.

 True, shortened versions of these explanations.

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


More information about the tor-bugs mailing list