Apple Motion 1.0.1 Manual do Utilizador Página 10

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 41
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 9
2.3 Motion Chart Example
Following the documentation of the Google Motion Chart API we need a data
set which has at least four columns: one identifying the variable we would like to
plot, one time variable and at least two n umerical variables, further numerical and
character columns are allowed.
As an example we use the Fruits data set:
R> data(Fruits)
R> Fruits
Fruit Year Location Sales Expenses Profit Date
1 Apples 2008 West 98 78 20 2008-12-31
2 Apples 2009 West 111 79 32 2009-12-31
3 Apples 2010 West 89 76 13 2010-12-31
4 Oranges 2008 East 96 81 15 2008-12-31
5 Bananas 2008 East 85 76 9 2008-12-31
6 Oranges 2009 East 93 80 13 2009-12-31
7 Bananas 2009 East 94 78 16 2009-12-31
8 Oranges 2010 East 98 91 7 2010-12-31
9 Bananas 2010 East 81 71 10 2010-12-31
Here we will use the columns ’Fruit’ and ’Year’ as id and time variable respec-
tively. However we could have used ’Date’ inste ad of ’Year’ as well.
R> M <- gvisMotionChart(Fruits, idvar="Fruit", timevar="Year")
The structural output of gvisMotionChart is a list of lists as described above
R> str(M)
List of 3
$ type : chr "MotionChart"
$ chartid: chr "MotionChartID212d6d31dc7d"
$ html :List of 4
..$ header : chr "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
..$ chart : Named chr [1:7] "<!-- MotionChart generated in R 3.
.. ..- attr(*, "names")= chr [1:7] "jsHeader" "jsData" "jsDrawCh
..$ caption: chr "<div><span>Data: Fruits &#8226; Chart ID: <a h
..$ footer : chr "\n<!-- htmlFooter -->\n<span> \n R Under deve
- attr(*, "class")= chr [1:2] "gvis" "list"
The first two items of the list contain information about the chart type used and
the individual chart id:
10
Vista de página 9
1 2 ... 5 6 7 8 9 10 11 12 13 14 15 ... 40 41

Comentários a estes Manuais

Sem comentários