Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Grammar of Graphics Ch5. Algebra

Afeb8054efb8e03aab4ed7d90a52f11c?s=47 nacyot
August 18, 2015

The Grammar of Graphics Ch5. Algebra

2015. 8. 18. 토즈 강남점 발표
정보시각화 고전 스터디 모임 - The Grammar of Graphics Ch5. Algebra 보충
by nacyot http://blog.nacyot.com

이 발표는 정보시각화 고전 스터디에서 발표된 내용으로 Leland Wilkinson의 The Grammar of Graphics의 제 5장 Agebra 파트를 보충 설명하고 있습니다.

https://medium.com/infovis-kr/%EC%A0%95%EB%B3%B4%EC%8B%9C%EA%B0%81%ED%99%94-%EA%B3%A0%EC%A0%84-%EB%8F%85%EC%84%9C-%EB%AA%A8%EC%9E%84-c9b1ef976405

특히 Variable, Varset, Table 등 데이터의 표현 방법들과 연산이 적용되는 과정을 중점적으로 소개하며, 이러한 연산이 어떻게 Frame을 정의하고 그래프로 그려지는 지 보여준다.

Afeb8054efb8e03aab4ed7d90a52f11c?s=128

nacyot

August 18, 2015
Tweet

Transcript

  1. The Grammar of Graphics Algebra ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ -

    The Grammar of Ghapcis 5੢ © nacyot 2015 - 1
  2. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ 5ߣ૩ 2015. 8. 18. ੿ࠁदпച Ҋ੹

    ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 2
  3. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 3
  4. 2.1.8 Variable a variable is • the domain is a

    set of objects, • the codomain is a set of values, • the function assigns to each element of an element in ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 4
  5. 2.1.8 ߸ࣻ(Variable) ߸ࣻ ח • ੿੄৉ ਷ ё୓ٜ੄ ૘೤ •

    ҕ৉ ਷ чٜ੄ ૘೤ • ೣࣻ ח ੄ п чٜਸ ੄ ਃࣗী ؀਽दఅ׮. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 5
  6. a set of objects ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The

    Grammar of Ghapcis 5੢ © nacyot 2015 - 6
  7. a set of values ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The

    Grammar of Ghapcis 5੢ © nacyot 2015 - 7
  8. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 8
  9. Variable • ప੉࠶ ಴അҗ ࠺त • 1 -> ant •

    2 -> bee • 3 -> drone • 4 -> moth ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 9
  10. 2.1.9 Varsets a varset is • the domain is a

    set of values, • the codomain is a set of all possible bags of objects, • the function assigns to each element of an element in ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 10
  11. 2.1.9 Varsets varset ח • بݫੋ ח чٜ੄ ૘೤ •

    ҕ৉ ח ݽٚ оמೠ ߔ(bags)ٜ੄ ૘೤ • ೣࣻ ח ੄ п чٜਸ ী ؀਽दఅ׮ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 11
  12. a set of Values ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The

    Grammar of Ghapcis 5੢ © nacyot 2015 - 12
  13. set of all possible bags of objects, ੿ࠁदпച Ҋ੹ ةࢲ

    ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 13
  14. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 14
  15. ׮ܲ Variable Y ৘ઁ • 1 -> red • 2

    -> red • 3 -> blue ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 15
  16. Varset Y • red -> <1,2> • blue -> <3>

    ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 16
  17. Varset਷ Variable੄ чٜ۽ ੋؙझػ ഋక ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ -

    The Grammar of Ghapcis 5੢ © nacyot 2015 - 17
  18. Table ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis

    5੢ © nacyot 2015 - 18
  19. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 19
  20. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 20
  21. 2. How To Make a Pie 2.2 Recipe ੿ࠁदпച Ҋ੹

    ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 21
  22. Variables(32p) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis

    5੢ © nacyot 2015 - 22
  23. Variables ੤੿੄ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 23
  24. Data Definition Statements SOURCE: <source name> = <fn>(<args>) DATA: <variable

    name> = <fn>(<args>) TRANS: <variable name> = <fn>(<args>) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 24
  25. SOURCE SOURCE: acls_data = csvSource(path("C:\\acls.csv")) csv file(੉ ઓ੤ೠ׮Ҋ о੿) CaseID,

    Gender, Response, ... 1, Male, Frequently, ... 2, Female, Not Sure, ... 3, Male, Frequently, ... ... 3834, Male, Rarely, ... 3835, Female, Infrequently, ... ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 25
  26. Source Table ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 26
  27. DATA SOURCE: acls_data = csvSource(path("C:\\acls.csv")) DATA: gender = col(source(acls_data), name("Gender"))

    DATA: response = col(source(acls_data), name("Response")) col ೣࣻܳ ా೧ࢲ gender, responce ߸ࣻ ೡ׼ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 27
  28. gender (1) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 28
  29. gender (2) select CaseID, Gender from acls_data ੿ࠁदпച Ҋ੹ ةࢲ

    ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 29
  30. response (1) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 30
  31. response (2) select CaseID, Response from acls_data ੿ࠁदпച Ҋ੹ ةࢲ

    ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 31
  32. Algebra ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis

    5੢ © nacyot 2015 - 32
  33. Varset Algebra ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 33
  34. Algebra৬ Frames (1) Graphics algebra provides a method for specifying

    F(which we call a frame) when we wish to construct agraphic based on some function of a set of data. — nVIZn 3p ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 34
  35. Algebra৬ Frames (2) This chapter deals with restoring and balancing

    sets of variables in order to create the specification for the frames in which graphs are embedded. — GoG Ch5. Algebra 63p ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 35
  36. Frame੉ۆ? A frame is a set of tuple ranging over

    all possible values in the domain of a p- dimensional varset. — GoG 30p Ӓې೐о Ӓ۰૑ח ҕрਸ ੿੄. (2ѐ varset੉ ੓ਸ ٸח ੌ߈੸ਵ۽ xyಣݶҗ э਷ 2ରਗ ಣݶਸ ੿੄) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 36
  37. Frame Specification • 1౸ীࢲח frame spcification੉ ੓঻਺(40p) FRAME: x *

    y GRAPH: point() • 2౸੄ ಴അߨ(39p) ELEMENT: point(position(x * y)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 37
  38. Symbol A symbol is used to represent an entity operated

    on by an algebra. The symbols in varset algebra are varsets. बࠅ਷ ؀ࣻधীࢲ ҅࢑غয૑ח ೦ݾਸ աఋմ׮. varset ؀ࣻधীࢲ बࠅ਷ varset੉׮. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 38
  39. Operators An operator is a method for relating symbols in

    an algebra. ো࢑੗ח ؀ࣻधীࢲ बࠅٜਸ ҙ҅૙ח ݫࢲ٘੉׮. • Cross(*), Nest(/), Blend(+) • Varsets( and ) • Value Domain of Varsets( and ) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 39
  40. Cross: ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis

    5੢ © nacyot 2015 - 40
  41. Cross( ) ࣻ೟੸ ੿੄ Varset ੿੄ Cross ੿੄ ੿ࠁदпച Ҋ੹

    ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 41
  42. ప੉࠶(Variable) ಴അਵ۽ ੉೧ೞӝ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar

    of Ghapcis 5੢ © nacyot 2015 - 42
  43. SELECT DISTINCT color.color, car.car FROM color CROSS JOIN car; color

    car ---------- ---------- red supercar red sportcar red minicar blue supercar blue sportcar blue minicar ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 43
  44. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 44
  45. (1) sql SELECT ('(' || color.color || ', ' ||

    car.car || ')') AS "Value Domain", GROUP_CONCAT( CASE WHEN color.key = car.key THEN color.key ELSE NULL END ) AS "Set of Cases" FROM color CROSS JOIN car GROUP BY "Value Domain"; ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 45
  46. (2) result Value Domain Set of Cases ---------------- ------------ (blue,

    minicar) 3 (blue, sportcar) 2 (blue, supercar) (red, minicar) (red, sportcar) (red, supercar) 1,4 ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 46
  47. Cross੄ ప੉࠶(Variable) ಴അ SELECT color.key, color.color, car.car FROM color, car

    WHERE color.key = car.key; ױ, ੿੄৉( ) ੹୓о ಴അػ׮ח ࠁ੢਷ হ਺. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 47
  48. Cross੄ Ӓې೐ ಴അ ELEMENT: point(position(color*car), text=key) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐

    - The Grammar of Ghapcis 5੢ © nacyot 2015 - 48
  49. Nest: ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis

    5੢ © nacyot 2015 - 49
  50. Cross৬ Nest੄ ࣻ೟੸ ੿੄ Cross( ) Nest( ) ੿ࠁदпച Ҋ੹

    ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 50
  51. খࢶ ৘ઁ੄ ప੉࠶(Variable) ಴അ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The

    Grammar of Ghapcis 5੢ © nacyot 2015 - 51
  52. SELECT DISTINCT color.color, car.car FROM color INNER JOIN car WHERE

    color.key = car.key; color car ---------- ---------- red supercar blue sportcar blue minicar ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 52
  53. # cross # nest color car color car ---------- ----------

    ---------- ---------- red supercar red supercar red sportcar blue sportcar red minicar blue minicar blue supercar blue sportcar blue minicar ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 53
  54. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 54
  55. Value Domain Set of Cases ---------------- ------------ (blue, minicar) 3

    (blue, sportcar) 2 (blue, supercar) (red, minicar) (red, sportcar) (red, supercar) 1,4 ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 55
  56. Value Domain Set of Cases ---------------- ------------ (blue, minicar) 3

    (blue, sportcar) 2 (red, supercar) 1,4 SELECT ('('||color.color||','||car.car||')') AS "Value Domain", GROUP_CONCAT(car.key) as "Set of Cases" FROM color INNER JOIN car WHERE color.key = car.key GROUP BY "Value Domain"; ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 56
  57. Nestো࢑਷ Frameਸ ٜ݅૑ ঋח׮ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The

    Grammar of Ghapcis 5੢ © nacyot 2015 - 57
  58. Nest ো࢑੄ ৉ೡ (1) Wilkinson presents three algebraic operators called

    cross ( ), nest( ), and blend ( ), together with the rules for their use. Theyare derived from the set operators product ( ), discreteunion ( ), and union ( ), respectively. — nVIZn 3p ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 58
  59. Nest ো࢑੄ ৉ೡ (2) The disjoint union of two sets

    A and B, denoted by A B, produces a set whose members are tagged elements. A tagged element is one of the form x:$, where x X is the element and the symbol $ is the tag. A tag is some- times called an identifier or a color; it may be a string, a numerical value, or another piece of information. — GoG 26p ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 59
  60. Nest ো࢑੄ ৉ೡ (3) The nesting variable tags the nested

    variable such that (s, t) implies (s : t). We will not use this notation below, but we will assume an algebra system can identify the nesting elements through a tagging index. — GoG 65p ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 60
  61. Nest ো࢑੄ ਊب • Tagging • Data values • Metadata

    • Data organization ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 61
  62. ప੉࠶۽ ૒ҙ੸ਵ۽ ੉೧ೞӝ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar

    of Ghapcis 5੢ © nacyot 2015 - 62
  63. d3.js੄ nest ೣࣻ۽ ੉೧ೞӝ (1) data = [ {color: 'red',

    car: 'supercar'}, {color: 'blue', car: 'sportcar'}, {color: 'blue', car: 'minicar'}, {color: 'red', car: 'supercar'} ] ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 63
  64. d3.js੄ nest ೣࣻ۽ ੉೧ೞӝ (2) var nestedData = d3.nest() .key(function(d)

    { return d.car; }) .map(dataSet); { 'supercar':[ {color: 'red', car: 'supercar'}, {color: 'red', car: 'supercar'}, ], 'sportcar':[ {color: 'blue', car: 'sportcar'}, ], 'minicar':[ {color: 'blue', car: minicar'}, ] } ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 64
  65. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 65
  66. Blend: ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis

    5੢ © nacyot 2015 - 66
  67. Blend੄ ࣻ೟੸ ੿੄ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar

    of Ghapcis 5੢ © nacyot 2015 - 67
  68. ೦١ਗ(Identity emelemnt) • +੄ ೦١ਗ: ҕ૘೤ • cross৬ nest੄ ೦١ਗ

    varset • ରࣻ(order)ܳ ݏ୶ӝ ਤ೧ࢲب ࢎਊ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 68
  69. cross ೦١ਗ(э਷ ಴അ) ELEMENT: point(position(pop1980)) ELEMENT: point(position(pop1980*1)) ੿ࠁदпച Ҋ੹ ةࢲ

    ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 69
  70. Expression • term(expression with no + operator) • factor(expression with

    no * operator) • monomial(one term) • polynomial(more than one term) • order(number of factors in term) • k(largest order among the monomials) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 70
  71. Algebraic Form An algebraic form is a monomial or a

    polynomial whose terms all have the same number of factors. • • • • ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 71
  72. ৵ ରࣻܳ ݏ୾ঠೡө? • ରࣻח Ӓې೐о Ӓ۰૑ח ҕр੄ ରਗਸ Ѿ੿

    • ରࣻо эইঠ Blend ো࢑ਸ ೡ ٸ ੄޷ܳ о૗ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 72
  73. Operator Precedence ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 73
  74. Ӓې೐੄ ࣁ҅۽ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 74
  75. 1ରਗ Ӓې೐ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 75
  76. pop1980 COORD: rect(dim(1)) ELEMENT: point(position(pop1980)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ -

    The Grammar of Ghapcis 5੢ © nacyot 2015 - 76
  77. 2ରਗ Ӓې೐ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 77
  78. pop1980 * 1 COORD: rect(dim(1, 2)) ELEMENT: point(position(pop1980 * 1))

    # FRAME = [0, 30] x unity ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 78
  79. pop1980 * pop2000 COORD: rect(dim(1,2)) ELEMENT: point(position(pop1980*pop2000)) # FRAME =

    [0, 30] x [0, 30] ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 79
  80. 3ରਗ Ӓې೐? ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 80
  81. ଼੄ ৘ઁ (1) ELEMENT: point(position(city*pop1980*group)) # FRAME = (Tokyo, ...)

    x [0, 30] x (World, USA) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 81
  82. ଼੄ ৘ઁ(2) - ખ ؊ ੿ഛೠ ಴അ COORD: rect(dim(3), rect(dim(1,2)))

    ELEMENT: point(position(city*pop1980*group)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 82
  83. 3ରਗ Ӓې೐! ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of

    Ghapcis 5੢ © nacyot 2015 - 83
  84. খ੄ ৘ઁܳ 3ରਗਵ۽ COORD: rect(dim(1,2,3)) ELEMENT: point(position(city*pop1980*group)) # FRAME =

    (Tokyo, ...) x [0, 30] x (World, USA) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 84
  85. Step by Step rect(dim(1,2,3)) to rect(dim(3), rect(dim(1,2))) ੿ࠁदпച Ҋ੹ ةࢲ

    ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 85
  86. 2ରਗ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis

    5੢ © nacyot 2015 - 86
  87. 3ରਗ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis

    5੢ © nacyot 2015 - 87
  88. World ಣݶਵ۽ ੜۄղӝ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar

    of Ghapcis 5੢ © nacyot 2015 - 88
  89. USA ಣݶਵ۽ ੜۄղӝ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar

    of Ghapcis 5੢ © nacyot 2015 - 89
  90. World, USA ಣݶਸ ٮ۽ ಟ୛֬ӝ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ -

    The Grammar of Ghapcis 5੢ © nacyot 2015 - 90
  91. city * pop1980 * group • э਷ 2ରਗ Frame(city*pop1980)੄ ಣݶٜ

    COORD: rect(dim(3), rect(dim(1,2))) ELEMENT: point(position(city*pop1980*group)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 91
  92. Nest ো࢑ ੉೧ೞӝ ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar

    of Ghapcis 5੢ © nacyot 2015 - 92
  93. ଼੄ ৘ઁ ELEMENT: point(position(city/group*pop2000)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The

    Grammar of Ghapcis 5੢ © nacyot 2015 - 93
  94. city/group civy/group੄ بݫੋ п కӒ(Ӓܛ)ਵ۽ ա׀ بݫੋ ੿ࠁदпച Ҋ੹ ةࢲ

    ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 94
  95. ࢲ۽ ׮ܲ 2ѐ੄ ಣݶ! ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The

    Grammar of Ghapcis 5੢ © nacyot 2015 - 95
  96. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 96
  97. ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢

    © nacyot 2015 - 97
  98. Figure 5.6 DATA: p1980 = "1980" DATA: p2000 = "2000"

    ELEMENT: point(position(city*(pop1980+pop2000)), color(p1980 + p2000)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 98
  99. Frame of Figure 5.6 • city*(pop1980+pop2000) element: point(position(city*(pop1980+pop2000))) # FRAME

    = {Tokyo, ...} x [0, 30] • city*pop2000 element: point(position(city*pop2000)) # FRAME = {Tokyo, ...} x [0, 30] ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 99
  100. Color Blend Operator GoG 310p ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ -

    The Grammar of Ghapcis 5੢ © nacyot 2015 - 100
  101. Figure 5.6, again DATA: p1980 = "1980" DATA: p2000 =

    "2000" ELEMENT: point(position(city*(pop1980+pop2000)), color(p1980 + p2000)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 101
  102. Figure 5.8 DATA: p1980 = "1980" DATA: p2000 = "2000"

    ELEMENT: point(position((city/group)*(pop1980+pop2000), color(p1980 + p2000)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 102
  103. Figure 5.9 DATA: p1980 = "Pop 1980 (millions)" DATA: p2000

    = "Pop 2000 (millions)" ELEMENT: point(position(city*(pop1980/p1980+pop2000/p2000))) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 103
  104. ggplot2۽ ch5 ৘ઁ ੤ҳഅ GOG ch5 Varget Algebra Example -

    Gist ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 104
  105. ggplot2৬ GoG • ggplot2 • Varset Algebra ѐ֛ਸ ૑ਗೞ૑ ঋ਺

    • दпചೞח data.frameਸ ޷ܻ ઑ੘೧ঠೣ scales = 'free' ২࣌ਵ۽ nest৬ ࠺तೞѱ ҳഅ ggplot(pop, aes(x = city2, y = pop2000_d)) + geom_point(colour = I('darkblue')) + # scales = 'free'ܳ ా೧ࢲ ಣݶীࢲ ҕ૘೤੉ غח (a, b) ஠పҊܻܳ ઁѢ facet_grid(. ~ group, scales = 'free') + scale_y_continuous(limits=c(0, 30)) ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar of Ghapcis 5੢ © nacyot 2015 - 105
  106. Thank you! @nacyo_t ੿ࠁदпച Ҋ੹ ةࢲ ݽ੐ - The Grammar

    of Ghapcis 5੢ © nacyot 2015 - 106