atherenergy / ggtimeseries Goto Github PK
View Code? Open in Web Editor NEWTime series visualisation
License: Other
Time series visualisation
License: Other
Hi,
great package! I am using the function stat_calendar_heatmap
and want to configure the size of a) the daily tiles and b) size of monthly tiles, i.e. the stroke width of the heatmaps / lines. Is this possible, if yes, how?
I have seen that this is possible in ggplot_calendar_heatmap
but this function is not flexible enough for me.
Thanks
Hello, thank you for the helpful package.
Calling ggplot_calendar_heatmap()
on a dataframe coerces it to class data.table permanently. This is surprising and unexpected behavior.
This also breaks code, because data.table overrides magritter / dplyr pipes, and completely changes the way the "." placeholder is treated.
Please make it so that ggplot_calendar_heatmap()
does not modify data (as it shouldn't), or at a minimum, warn users with a message() that their data is being modified, or require them to convert to a data.table themselves.
Would be better if available BibTeX citation info could be provided.
How can I use local names for months and days of week on calendar heatmaps? I would like to have them in portuguese. Thanks.
This package was removed from CRAN recently for reasons mentioned here:
https://cran.r-project.org/web/packages/ggTimeSeries/index.html
Are there plans to resubmit it and unarchive it?
If date column is formatted as POSIXct
, seq()
function produces dates with daylight saving applied. This results in a sequence of days with hour components 23:00:00
. When merge happens here
dtDateValue = merge(dtDateValue, setnames(dtDateValue[ ,list(DateCol = seq(min(get(cDateColumnName)), max(get(cDateColumnName)),"days")), vcGroupingColumnNames], "DateCol", cDateColumnName), c(vcGroupingColumnNames, cDateColumnName), all = T)
dtDateValue
is updated with NA
values for days that have the daylight savings are applied.
Adding na.value = "white"
to scale_fill_continuous()
reveals those NA
values like below.
One solutions is that user formats the dates with as.Date()
before plotting. Or, you might consider using as.POSIXct()
with tz
set to UTC
in seq()
and then merge.
There are no NA values in the dataset, however this is plotting an N/A year.
require(ggTimeSeries)
#> Loading required package: ggTimeSeries
#> Loading required package: ggplot2
require(tidyverse)
#> Loading required package: tidyverse
x <- structure(list(year = c(2017, 2017, 2017, 2017, 2017, 2018, 2018,
2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018,
2018, 2018, 2018, 2018),
date = structure(c(17479, 17480, 17483,
17505, 17528, 17534, 17569, 17581, 17591, 17611, 17639, 17640,
17644, 17655, 17694, 17701, 17702, 17704, 17709, 17714, 17715,
17735), class = "Date"),
n = c(23L, 22L, 24L, 5L, 19L, 2L, 5L,
10L, 5L, 6L, 13L, 2L, 1L, 6L, 2L, 13L, 1L, 32L, 17L, 1L, 3L,
14L)),
class = c("tbl_df", "tbl", "data.frame"),
row.names = c(NA, -22L))
x
#> # A tibble: 22 x 3
#> year date n
#> <dbl> <date> <int>
#> 1 2017 2017-11-09 23
#> 2 2017 2017-11-10 22
#> 3 2017 2017-11-13 24
#> 4 2017 2017-12-05 5
#> 5 2017 2017-12-28 19
#> 6 2018 2018-01-03 2
#> 7 2018 2018-02-07 5
#> 8 2018 2018-02-19 10
#> 9 2018 2018-03-01 5
#> 10 2018 2018-03-21 6
#> # ... with 12 more rows
x %>%
ggTimeSeries::ggplot_calendar_heatmap(cDateColumnName = "date", cValueColumnName = "n") +
facet_grid(year ~ .)
Created on 2018-08-13 by the reprex
package (v0.2.0).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.