cyclic_chart | R Documentation |
This function plots values corresponding to random periods such as hours, days, months and so on.
cyclic_chart(df, Period, Value, crit, ColV)
df |
A data frame |
Period |
A list of periodical values such as hours of the day, days of the week, months of the year and so on. |
Value |
A numeric vector with the values corresponding to the |
crit |
A factor variable based on which the bars would be colored. |
ColV |
A character vector with the list of colors for the bars. You can use this online tool (https://r-charts.com/color-palette-generator/) to create a beautiful color palette. |
This can plot values corresponding to multiple categories, for example, temperature in different cities on the days of a week, or rainfall by month in a year.
A ggplot
object, which can be further modified
with ggplot2
functions and themes.
day_chart()
for plotting values on a day by hours,
week_chart()
for plotting values in a week by days,
year_chart()
for plotting values in a year by months
# Using package built-in bdtemp data
Col <- c("#0040ff", "#00bfff", "#8000ff")
cyclic_chart(bdtemp,
Period = Month, Value = Temperature,
crit = City, ColV = Col
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.