DATA VISUALIZATION IN R WITH GGVIS

Report 2 Downloads 219 Views
DATA VISUALIZATION IN R WITH GGVIS

Compute functions

Data Visualization in R with ggvis

layer_smooths

mtcars %>%

ggvis(~mpg, ~wt) %>%

layer_smooths()

mtcars %>%

compute_smooth(wt ~ mpg) %>% ggvis(~pred_, ~resp_) %>%

layer_paths()

Data Visualization in R with ggvis

properties mpg

cyl

disp

wt

21.0

6

160.0

2.6

21.0

6

160.0

2.9

22.8

4

108.0

2.3

21.4

6

258.0

3.2

18.7

8

360.0

3.4

18.1

6

225.0

3.5

14.3

8

360.0

3.6

24.4

4

146.7

3.2

22.8

4

140.8

3.1

19.2

6

167.6

3.4

17.8

6

167.6

3.4

16.4

8

275.8

4.1

17.3

8

275.8

3.7

15.2

8

275.8

3.8

10.4

8

472.0

5.2

10.4

8

460.0

5.4

14.7

8

440.0

5.3

32.4

4

78.7

2.2

30.4

4

75.7

1.6

33.9

4

71.1

1.8

data

compute

x

y

pred_

resp_

1.51 1.56 1.61 1.66 1.71 1.76 1.81 1.86 1.91 1.96 2.01 2.06 2.11 2.16 2.21 2.26 2.31 2.35 2.40 2.45

32.09 31.69 31.28 30.87 30.45 30.03 29.61 29.18 28.74 28.30 27.83 27.35 26.84 26.33 25.82 25.30 24.79 24.30 23.82 23.37

mark

coordinate system

Data Visualization in R with ggvis

points

paths

rects

ribbons

text

+ compute functions

smooths

model_predictions

bars

etc. histograms

densities

DATA VISUALIZATION IN R WITH GGVIS

Let's practice!

DATA VISUALIZATION IN R WITH GGVIS

Grouped data

Data Visualization in R with ggvis

dplyr Hadley

Wickham

Data Visualization in R with ggvis

mtcars %>% ggvis(~wt, ~mpg) %>% layer_paths()

mpg

cyl

disp

wt

21.0

6

160.0

2.6

21.0

6

160.0

2.9

22.8

4

108.0

2.3

21.4

6

258.0

3.2

18.7

8

360.0

3.4

18.1

6

225.0

3.5

14.3

8

360.0

3.6

24.4

4

146.7

3.2

22.8

4

140.8

3.1

19.2

6

167.6

3.4

17.8

6

167.6

3.4

16.4

8

275.8

4.1

17.3

8

275.8

3.7

15.2

8

275.8

3.8

10.4

8

472.0

5.2

10.4

8

460.0

5.4

14.7

8

440.0

5.3

32.4

4

78.7

2.2

30.4

4

75.7

1.6

33.9

4

71.1

1.8

Data Visualization in R with ggvis

mtcars %>% ggvis(~wt, ~mpg) %>% arrange(wt) %>% layer_paths() mtcars %>% ggvis(~wt, ~mpg) %>% layer_lines()

Data Visualization in R with ggvis

group_by

Data Visualization in R with ggvis

DATA VISUALIZATION IN R WITH GGVIS

Let's practice!