Google Calendar Chart with R \Sexpr{googleChartName <- "Calendar"} \Sexpr{gvisChartName <- "gvisCalendar"}

Description

A calendar chart is a visualization used to show activity over the course of a long span of time, such as months or years. They're best used when you want to illustrate how some quantity varies depending on the day of the week, or how it trends over time.

Usage

1
gvisCalendar(data, datevar = "", numvar = "", options = list(), chartid)

Arguments

data

a data.frame. The data has to have at least two columns, one with date information (datevar) and one numerical variable.

datevar

column name of data which shows the date dimension. The information has to be of class Date or POSIX* time series.

numvar

column name of data which shows the values to be displayed against datevar. The information has to be numeric.

options

list of configuration options, see:

\Sexpr[results=rd]{gsub("CHARTNAME", googleChartName, readLines(file.path(".", "inst", "mansections", "GoogleChartToolsURLConfigOptions.txt")))} \Sexpr[results=rd]{paste(readLines(file.path(".", "inst", "mansections", "gvisOptions.txt")))}
chartid

character. If missing (default) a random chart id will be generated based on chart type and tempfile.

Value

\Sexpr[results=rd]{paste(gvisChartName)}

returns list of class \Sexpr[results=rd]{paste(readLines(file.path(".", "inst", "mansections", "gvisOutputStructure.txt")))}

Warning

The calendar chart may be undergoing substantial revisions in future Google Charts releases.

Author(s)

Markus Gesmann markus.gesmann@gmail.com,

Diego de Castillo decastillo@gmail.com

References

Google Chart Tools API: \Sexpr[results=rd]{gsub("CHARTNAME", googleChartName, readLines(file.path(".", "inst", "mansections", "GoogleChartToolsURL.txt")))}

See Also

See also print.gvis, plot.gvis for printing and plotting methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
cl1 <- gvisCalendar(Cairo, datevar="Date", numvar="Temp")
plot(cl1)

## Not all months shown? 
## We can change the setting of the width ...

cl2 <- gvisCalendar(Cairo, datevar="Date", numvar="Temp",
                    options=list(width=1000))
plot(cl2)

## ... or the cell size
cl3 <- gvisCalendar(Cairo, datevar="Date", 
                    numvar="Temp", 
                    options=list(calendar="{ cellSize: 10 }"))
plot(cl3)

## Example with many options set
cl4 <- gvisCalendar(Cairo, datevar="Date", numvar="Temp",
                    options=list(
                    title="Daily temperature in Cairo",
                    height=320,
                    calendar="{yearLabel: { fontName: 'Times-Roman',
                               fontSize: 32, color: '#1A8763', bold: true},
                               cellSize: 10,
                               cellColor: { stroke: 'red', strokeOpacity: 0.2 },
                               focusedCellColor: {stroke:'red'}}")
                  )
plot(cl4)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.