Skip to content

Commit 2bdc7f9

Browse files
committed
fixed links
1 parent 8e3b066 commit 2bdc7f9

14 files changed

+69
-62
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
^cran-comments\.md$
1515
^\.github$
1616
^\.github/workflows/R-CMD-check\.yaml$
17+
^CRAN-SUBMISSION$

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: sugrrants
22
Title: Supporting Graphs for Analysing Time Series
3-
Version: 0.2.8
3+
Version: 0.2.9
44
Authors@R:
55
c(person(given = "Earo",
66
family = "Wang",
@@ -46,4 +46,4 @@ Encoding: UTF-8
4646
Language: en-GB
4747
LazyData: true
4848
Roxygen: list(markdown = TRUE)
49-
RoxygenNote: 7.1.1
49+
RoxygenNote: 7.2.3

R/prettify.R

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' "text" are used. If "text2" is specified for the "monthly" calendar only,
88
#' it will add day of month to the `ggplot` object.
99
#' @param locale ISO 639 language code. The default is "en" (i.e. US English).
10-
#' For other languages support, package **readr** needs to be installed.
10+
#' For other languages support, package **readr** needs to be installed.
1111
#' See [readr::locale] for more details.
1212
#' @param abbr Logical to specify if the abbreviated version of label should be
1313
#' used.
@@ -48,11 +48,11 @@ prettify.plotly <- function(plot, label = c("label", "text"), locale, abbr = TRU
4848
label <- lst$label
4949
text <- lst$text
5050
if ("label" %in% label_arg) {
51-
plot <- plot %>%
51+
plot <- plot %>%
5252
plotly::add_text(x = ~ x, y = ~ y, text = ~ label, data = label, ...)
5353
}
5454
if ("text" %in% label_arg) {
55-
plot <- plot %>%
55+
plot <- plot %>%
5656
plotly::add_text(x = ~ x, y = ~ y - 0.03, text = ~ label, data = text, ...)
5757
}
5858
if ("text2" %in% label_arg) {
@@ -90,6 +90,7 @@ prettify.ggplot <- function(plot, label = c("label", "text"), locale, abbr = TRU
9090
text_param <- text2_param <- param_list[which(names_param %in% text_all)]
9191
}
9292

93+
label_arg <- c("label", "text")
9394
if ("label" %in% label_arg) {
9495
label_param$data <- label
9596
label_param$mapping <- aes(x, y, label = label)

README.Rmd

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ options(tibble.print_min = 5)
1616
# sugrrants
1717

1818
[![R build status](https://github.com/earowang/sugrrants/workflows/R-CMD-check/badge.svg)](https://github.com/earowang/sugrrants/actions?workflow=R-CMD-check)
19-
[![Coverage Status](https://codecov.io/gh/earowang/sugrrants/branch/master/graph/badge.svg)](https://codecov.io/github/earowang/sugrrants?branch=master)
2019
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/sugrrants)](https://cran.r-project.org/package=sugrrants)
2120
[![Downloads](http://cranlogs.r-pkg.org/badges/sugrrants?color=brightgreen)](https://cran.r-project.org/package=sugrrants)
2221

@@ -75,7 +74,7 @@ This package is part of the project---[Tidy data structures and visual methods t
7574

7675
A new function `frame_calendar()` [[here](https://github.com/earowang/sugrrants/blob/master/R/frame-calendar.R) and [here](https://github.com/earowang/sugrrants/blob/master/R/calendar-fun.R)] in the **sugrrants** package has been developed and documented for calendar-based graphics. I have also written a vignette [[source](https://github.com/earowang/sugrrants/blob/master/vignettes/frame-calendar.Rmd) and [reader view](https://pkg.earo.me/sugrrants/articles/frame-calendar.html)], which introduces and demonstrates the usage of the `frame_calendar()` function. [Many unit tests](https://github.com/earowang/sugrrants/blob/master/tests/testthat/test-calendar.R) have been carried out to ensure the expected performance of this function. The function implements non-standard evaluation and highlights the [tidy evaluation](https://rlang.r-lib.org) in action. The initial release (v0.1.0) of the package has been published on [CRAN](https://CRAN.R-project.org/package=sugrrants) during the gsoc summer time.
7776

78-
I have initialised a new R package [**tsibble**](https://github.com/earowang/tsibble) for tidy temporal data, as part of the project. The `tsibble()` function constructs a new `tbl_ts` class for temporal data, and the `as_tsibble()` helps to convert a few `ts` objects into the `tbl_ts` class. Some key verbs (generics) from the **dplyr** package, such as `mutate()`, `summarise()`, `filter()`, have been defined and developed for the `tbl_ts` data class. The **tsibble** package was highly experimental over the period of the gsoc [[commits](https://github.com/earowang/tsibble/commit/aba1cfc2eec88966c43232fe5d249522f88e1e27)], and these functions are very likely to be changed or improved in the future.
77+
I have initialised a new R package [**tsibble**](https://github.com/tidyverts/tsibble) for tidy temporal data, as part of the project. The `tsibble()` function constructs a new `tbl_ts` class for temporal data, and the `as_tsibble()` helps to convert a few `ts` objects into the `tbl_ts` class. Some key verbs (generics) from the **dplyr** package, such as `mutate()`, `summarise()`, `filter()`, have been defined and developed for the `tbl_ts` data class. The **tsibble** package was highly experimental over the period of the gsoc [[commits](https://github.com/tidyverts/tsibble/commit/aba1cfc2eec88966c43232fe5d249522f88e1e27)], and these functions are very likely to be changed or improved in the future.
7978

8079
A new package [**rwalkr**](https://github.com/earowang/rwalkr) has been created and released on [CRAN](https://cran.r-project.org/package=rwalkr) during the gsoc summer. This package provides API to Melbourne pedestrian sensor data and arrange the data in tidy temporal data form. Two functions including [`walk_melb()`](https://github.com/earowang/rwalkr/blob/master/R/scrape.R) and [`shine_melb()`](https://github.com/earowang/rwalkr/blob/master/R/shiny.R), have been written and documented as the v0.1.0 and v0.2.0 releases on CRAN. The majority of the code for the function [`run_melb()`](https://github.com/earowang/rwalkr/blob/master/R/soda.R) has been done, but the interface needs improving after the gsoc.
8180
</details>

README.md

+36-35
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11

22
<!-- README.md is generated from README.Rmd. Please edit that file -->
33

4-
sugrrants
5-
=========
4+
# sugrrants
65

76
[![R build
87
status](https://github.com/earowang/sugrrants/workflows/R-CMD-check/badge.svg)](https://github.com/earowang/sugrrants/actions?workflow=R-CMD-check)
9-
[![Coverage
10-
Status](https://codecov.io/gh/earowang/sugrrants/branch/master/graph/badge.svg)](https://codecov.io/github/earowang/sugrrants?branch=master)
11-
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/sugrrants)](https://cran.r-project.org/package=sugrrants)
8+
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/sugrrants)](https://cran.r-project.org/package=sugrrants)
129
[![Downloads](http://cranlogs.r-pkg.org/badges/sugrrants?color=brightgreen)](https://cran.r-project.org/package=sugrrants)
1310

1411
The goal of *sugrrants* is to provide supporting graphs with R for
1512
analysing time series data. It aims to fit into the *tidyverse* and
1613
grammar of graphics framework for handling temporal data.
1714

18-
Installation
19-
------------
15+
## Installation
2016

2117
You could install the stable version on CRAN:
2218

23-
install.packages("sugrrants")
19+
``` r
20+
install.packages("sugrrants")
21+
```
2422

2523
You could also install the development version from Github using:
2624

27-
# install.packages("remotes")
28-
remotes::install_github("earowang/sugrrants")
25+
``` r
26+
# install.packages("remotes")
27+
remotes::install_github("earowang/sugrrants")
28+
```
2929

30-
Usage
31-
-----
30+
## Usage
3231

3332
### Calendar-based graphics
3433

3534
The fully-fledged faceting calendar `facet_calendar()` unlocks
3635
day-to-day stories.
3736

38-
library(dplyr)
39-
library(sugrrants)
40-
hourly_peds %>%
41-
filter(Date < as.Date("2016-05-01")) %>%
42-
ggplot(aes(x = Time, y = Hourly_Counts, colour = Sensor_Name)) +
43-
geom_line() +
44-
facet_calendar(~ Date) + # a variable contains dates
45-
theme_bw() +
46-
theme(legend.position = "bottom")
37+
``` r
38+
library(dplyr)
39+
library(sugrrants)
40+
hourly_peds %>%
41+
filter(Date < as.Date("2016-05-01")) %>%
42+
ggplot(aes(x = Time, y = Hourly_Counts, colour = Sensor_Name)) +
43+
geom_line() +
44+
facet_calendar(~ Date) + # a variable contains dates
45+
theme_bw() +
46+
theme(legend.position = "bottom")
47+
```
4748

4849
![](man/figures/facet-calendar-1.png)<!-- -->
4950

@@ -52,19 +53,20 @@ re-structuring the data into a compact calendar layout, without using
5253
the faceting method. It is fast and light-weight, although it does not
5354
preserve the values.
5455

55-
p <- hourly_peds %>%
56-
filter(Sensor_ID == 9, Year == 2016) %>%
57-
mutate(Weekend = if_else(Day %in% c("Saturday", "Sunday"), "Weekend", "Weekday")) %>%
58-
frame_calendar(x = Time, y = Hourly_Counts, date = Date) %>%
59-
ggplot(aes(x = .Time, y = .Hourly_Counts, group = Date, colour = Weekend)) +
60-
geom_line() +
61-
theme(legend.position = "bottom")
62-
prettify(p)
56+
``` r
57+
p <- hourly_peds %>%
58+
filter(Sensor_ID == 9, Year == 2016) %>%
59+
mutate(Weekend = if_else(Day %in% c("Saturday", "Sunday"), "Weekend", "Weekday")) %>%
60+
frame_calendar(x = Time, y = Hourly_Counts, date = Date) %>%
61+
ggplot(aes(x = .Time, y = .Hourly_Counts, group = Date, colour = Weekend)) +
62+
geom_line() +
63+
theme(legend.position = "bottom")
64+
prettify(p)
65+
```
6366

6467
![](man/figures/calendar-plot-1.png)<!-- -->
6568

66-
Google Summer of Code 2017
67-
--------------------------
69+
## Google Summer of Code 2017
6870

6971
<details>
7072

@@ -94,15 +96,15 @@ release (v0.1.0) of the package has been published on
9496
summer time.
9597

9698
I have initialised a new R package
97-
[**tsibble**](https://github.com/earowang/tsibble) for tidy temporal
99+
[**tsibble**](https://github.com/tidyverts/tsibble) for tidy temporal
98100
data, as part of the project. The `tsibble()` function constructs a new
99101
`tbl_ts` class for temporal data, and the `as_tsibble()` helps to
100102
convert a few `ts` objects into the `tbl_ts` class. Some key verbs
101103
(generics) from the **dplyr** package, such as `mutate()`,
102104
`summarise()`, `filter()`, have been defined and developed for the
103105
`tbl_ts` data class. The **tsibble** package was highly experimental
104106
over the period of the gsoc
105-
\[[commits](https://github.com/earowang/tsibble/commit/aba1cfc2eec88966c43232fe5d249522f88e1e27)\],
107+
\[[commits](https://github.com/tidyverts/tsibble/commit/aba1cfc2eec88966c43232fe5d249522f88e1e27)\],
106108
and these functions are very likely to be changed or improved in the
107109
future.
108110

@@ -120,8 +122,7 @@ CRAN. The majority of the code for the function
120122
has been done, but the interface needs improving after the gsoc.
121123
</details>
122124

123-
Miscellaneous
124-
-------------
125+
## Miscellaneous
125126

126127
The acronym of *sugrrants* is **SU**pporting **GR**aphs with **R** for
127128
**AN**alysing **T**ime **S**eries, pronounced as “sugar ants” that are a

cran-comments.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
This is a resubmission, which fixed (possibly) invalid URLs.
1+
This is a submission to fix cran errors
22

33
## Test environments
44

5-
* local OS X install, R 4.0.2
5+
* local OS X install, R 4.3.0
66
* github ci
77

88
## R CMD check results

inst/CITATION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
citHeader("To cite calendar-based graphics in publications, please use:")
22

3-
citEntry(entry = "article",
3+
bibentry(bibtype = "Article",
44
author = "Earo Wang and Dianne Cook and Rob J Hyndman",
55
title = "Calendar-based graphics for visualizing people's daily schedules",
66
journal = "Journal of Computational and Graphical Statistics",

man/facet-calendar.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/figures/calendar-plot-1.png

-11 Bytes
Loading

man/figures/facet-calendar-1.png

13.5 KB
Loading

man/stat_acf.Rd

+11-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/sugrrants-geom.Rd

+8-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sugrrants.Rproj

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Version: 1.0
33
RestoreWorkspace: No
44
SaveWorkspace: No
55
AlwaysSaveHistory: Default
6-
QuitChildProcessesOnExit: Default
76

87
EnableCodeIndexing: Yes
98
UseSpacesForTab: Yes

vignettes/frame-calendar.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ options(tibble.print_min = 5)
2525

2626
Calendar-based graphics turn out to be a useful tool for visually unfolding people's daily schedules in detail, such as hourly foot traffic in the CBD, daily residential electricity demand and etc. It arranges the values according to the corresponding dates into a calendar layout, which is comprised of weekdays in columns and weeks of a month in rows for a common monthly calendar. The idea originates from @van_wijk_cluster_1999 and is implemented in a couple of R packages ([ggTimeSeries](https://github.com/AtherEnergy/ggTimeSeries) and [ggcal](https://github.com/jayjacobs/ggcal)), yet they all are a variant of heatmap in temporal context. We extend the calendar-based graphics to a broader range of applications using linear algebra tools. For example, (1) it not only handles the data of daily intervals but also of higher frequencies like hourly data; (2) it is no longer constrained to a heatmap but can be used with other types of *Geoms*; (3) the built-in calendars include *monthly*, *weekly*, and *daily* types for the purpose of comparison between different temporal components. The `frame_calendar()` function returns the computed calendar grids as a data frame or a tibble according to its data input, and *ggplot2* takes care of the plotting as you usually do with a data frame.
2727

28-
We are going to use Melbourne pedestrian data (shipped with the package) as an example throughout the vignette, which is sourced from [Melbourne Open Data Portal](http://www.pedestrian.melbourne.vic.gov.au). The subset of the data contains 7 sensors counting foot traffic at hourly intervals across the city of Melbourne from January to April in 2017.
28+
We are going to use Melbourne pedestrian data (shipped with the package) as an example throughout the vignette, which is sourced from Melbourne Open Data Portal. The subset of the data contains 7 sensors counting foot traffic at hourly intervals across the city of Melbourne from January to April in 2017.
2929

3030
```{r load}
3131
library(tidyr)

0 commit comments

Comments
 (0)