MyNixOS website logo
Description

Supporting Graphs for Analysing Time Series.

Provides 'ggplot2' graphics for analysing time series data. It aims to fit into the 'tidyverse' and grammar of graphics framework for handling temporal data.

sugrrants

R buildstatus CRAN_Status_Badge Downloads

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

Installation

You could install the stable version on CRAN:

install.packages("sugrrants")

You could also install the development version from Github using:

# install.packages("remotes")
remotes::install_github("earowang/sugrrants")

Usage

Calendar-based graphics

The fully-fledged faceting calendar facet_calendar() unlocks day-to-day stories.

library(dplyr)
library(sugrrants)
hourly_peds %>%
  filter(Date < as.Date("2016-05-01")) %>% 
  ggplot(aes(x = Time, y = Hourly_Counts, colour = Sensor_Name)) +
  geom_line() +
  facet_calendar(~ Date) + # a variable contains dates
  theme_bw() +
  theme(legend.position = "bottom")

On the other hand, the frame_calendar() provides tools for re-structuring the data into a compact calendar layout, without using the faceting method. It is fast and light-weight, although it does not preserve the values.

p <- hourly_peds %>%
  filter(Sensor_ID == 9, Year == 2016) %>%
  mutate(Weekend = if_else(Day %in% c("Saturday", "Sunday"), "Weekend", "Weekday")) %>%
  frame_calendar(x = Time, y = Hourly_Counts, date = Date) %>% 
  ggplot(aes(x = .Time, y = .Hourly_Counts, group = Date, colour = Weekend)) +
  geom_line() +
  theme(legend.position = "bottom")
prettify(p)

Google Summer of Code 2017

This package is part of the project—Tidy data structures and visual methods to support exploration of big temporal-context data, which has been participated in Google Summer of Code 2017 (gsoc), for R project for statistical computing.

A new function frame_calendar() [here and here] in the sugrrants package has been developed and documented for calendar-based graphics. I have also written a vignette [source and reader view], which introduces and demonstrates the usage of the frame_calendar() function. Many unit tests have been carried out to ensure the expected performance of this function. The function implements non-standard evaluation and highlights the tidy evaluation in action. The initial release (v0.1.0) of the package has been published on CRAN during the gsoc summer time.

I have initialised a new R package 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], and these functions are very likely to be changed or improved in the future.

A new package rwalkr has been created and released on CRAN 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() and shine_melb(), 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() has been done, but the interface needs improving after the gsoc.

Miscellaneous

The acronym of sugrrants is SUpporting GRaphs with R for ANalysing Time Series, pronounced as “sugar ants” that are a species of ant endemic to Australia.


Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Metadata

Version

0.2.9

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows