diff --git a/R/geom-flow.r b/R/geom-flow.r index c071b64e..c2839fd4 100644 --- a/R/geom-flow.r +++ b/R/geom-flow.r @@ -102,7 +102,7 @@ GeomFlow <- ggproto( aesthetics <- intersect(.color_diff_aesthetics, names(data)) # arrange data by aesthetics for consistent (reverse) z-ordering data <- data[do.call(order, lapply( - data[, c("pair", aesthetics)], + data[, c("step", aesthetics)], function(x) factor(x, levels = unique(x)) )), ] diff --git a/R/self-adjoin.r b/R/self-adjoin.r index d45ac485..e19c5cdf 100644 --- a/R/self-adjoin.r +++ b/R/self-adjoin.r @@ -42,9 +42,9 @@ self_adjoin <- function( # self-(inner )join `link` variables by `key` and `by` adj <- dplyr::inner_join( - transform(data, pair = key_num)[, c("pair", by, link)], - transform(data, pair = key_num - 1)[, c("pair", by, link)], - by = c("pair", by), + transform(data, step = key_num)[, c("step", by, link)], + transform(data, step = key_num - 1)[, c("step", by, link)], + by = c("step", by), suffix = suffix ) @@ -52,15 +52,15 @@ self_adjoin <- function( if (!is.null(keep.x)) { adj <- dplyr::left_join( adj, - transform(data, pair = key_num)[, c("pair", by, keep.x)], - by = c("pair", by) + transform(data, step = key_num)[, c("step", by, keep.x)], + by = c("step", by) ) } if (!is.null(keep.y)) { adj <- dplyr::left_join( adj, - transform(data, pair = key_num - 1)[, c("pair", by, keep.y)], - by = c("pair", by) + transform(data, step = key_num - 1)[, c("step", by, keep.y)], + by = c("step", by) ) } diff --git a/docs/articles/ggalluvial.html b/docs/articles/ggalluvial.html index 66cc1e52..320dfd94 100644 --- a/docs/articles/ggalluvial.html +++ b/docs/articles/ggalluvial.html @@ -264,102 +264,54 @@

## tz America/New_York ## date 2018-06-26
## Packages -----------------------------------------------------------------
-
##  package      * version    date      
-##  assertthat     0.2.0      2017-04-11
-##  backports      1.1.2      2017-12-13
-##  base         * 3.3.3      2017-03-07
-##  bindr          0.1.1      2018-03-13
-##  bindrcpp     * 0.2.2      2018-03-29
-##  colorspace     1.3-2      2016-12-14
-##  datasets     * 3.3.3      2017-03-07
-##  devtools       1.13.5     2018-02-18
-##  digest         0.6.15     2018-01-28
-##  dplyr          0.7.4      2017-09-28
-##  evaluate       0.10.1     2017-06-24
-##  ggalluvial   * 0.9.0      2018-06-26
-##  ggplot2      * 2.2.1.9000 2018-06-26
-##  glue           1.2.0      2017-10-29
-##  graphics     * 3.3.3      2017-03-07
-##  grDevices    * 3.3.3      2017-03-07
-##  grid           3.3.3      2017-03-07
-##  gtable         0.2.0      2016-02-26
-##  htmltools      0.3.6      2017-04-28
-##  knitr          1.18       2017-12-27
-##  labeling       0.3        2014-08-23
-##  lazyeval       0.2.1      2017-10-29
-##  magrittr       1.5        2014-11-22
-##  memoise        1.1.0      2017-04-21
-##  methods      * 3.3.3      2017-03-07
-##  munsell        0.4.3      2016-02-13
-##  pillar         1.1.0      2018-01-14
-##  pkgconfig      2.0.1      2017-03-21
-##  plyr           1.8.4      2016-06-08
-##  purrr          0.2.4      2017-10-18
-##  R6             2.2.2      2017-06-17
-##  RColorBrewer   1.1-2      2014-12-07
-##  Rcpp           0.12.17    2018-05-18
-##  rlang          0.2.0.9001 2018-06-26
-##  rmarkdown      1.8        2017-11-17
-##  rprojroot      1.3-2      2018-01-03
-##  scales         0.5.0.9000 2018-06-18
-##  stats        * 3.3.3      2017-03-07
-##  stringi        1.2.2      2018-05-02
-##  stringr        1.2.0      2017-02-18
-##  tibble         1.4.2      2018-01-22
-##  tidyr          0.7.2      2017-10-16
-##  tidyselect     0.2.3      2017-11-06
-##  tools          3.3.3      2017-03-07
-##  utils        * 3.3.3      2017-03-07
-##  withr          2.1.2      2018-06-26
-##  yaml           2.1.19     2018-05-01
-##  source                                
-##  cran (@0.2.0)                         
-##  CRAN (R 3.3.2)                        
-##  local                                 
-##  CRAN (R 3.3.3)                        
-##  CRAN (R 3.3.3)                        
-##  CRAN (R 3.3.2)                        
-##  local                                 
-##  CRAN (R 3.3.3)                        
-##  CRAN (R 3.3.3)                        
-##  CRAN (R 3.3.2)                        
-##  CRAN (R 3.3.2)                        
-##  local (corybrunson/ggalluvial@ca234a6)
-##  Github (tidyverse/ggplot2@348b26f)    
-##  CRAN (R 3.3.2)                        
-##  local                                 
-##  local                                 
-##  local                                 
-##  CRAN (R 3.3.0)                        
-##  cran (@0.3.6)                         
-##  CRAN (R 3.3.2)                        
-##  CRAN (R 3.3.0)                        
-##  cran (@0.2.1)                         
-##  CRAN (R 3.3.0)                        
-##  CRAN (R 3.3.2)                        
-##  local                                 
-##  CRAN (R 3.3.0)                        
-##  CRAN (R 3.3.3)                        
-##  CRAN (R 3.3.2)                        
-##  CRAN (R 3.3.0)                        
-##  cran (@0.2.4)                         
-##  cran (@2.2.2)                         
-##  CRAN (R 3.3.0)                        
-##  CRAN (R 3.3.3)                        
-##  Github (tidyverse/rlang@ba4fb06)      
-##  CRAN (R 3.3.2)                        
-##  CRAN (R 3.3.3)                        
-##  Github (hadley/scales@4056ec3)        
-##  local                                 
-##  CRAN (R 3.3.3)                        
-##  CRAN (R 3.3.2)                        
-##  CRAN (R 3.3.3)                        
-##  CRAN (R 3.3.2)                        
-##  CRAN (R 3.3.2)                        
-##  local                                 
-##  local                                 
-##  Github (jimhester/withr@fe56f20)      
-##  CRAN (R 3.3.3)
+
##  package      * version    date       source                            
+##  assertthat     0.2.0      2017-04-11 cran (@0.2.0)                     
+##  backports      1.1.2      2017-12-13 CRAN (R 3.3.2)                    
+##  base         * 3.3.3      2017-03-07 local                             
+##  bindr          0.1.1      2018-03-13 CRAN (R 3.3.3)                    
+##  bindrcpp     * 0.2.2      2018-03-29 CRAN (R 3.3.3)                    
+##  colorspace     1.3-2      2016-12-14 CRAN (R 3.3.2)                    
+##  datasets     * 3.3.3      2017-03-07 local                             
+##  devtools       1.13.5     2018-02-18 CRAN (R 3.3.3)                    
+##  digest         0.6.15     2018-01-28 CRAN (R 3.3.3)                    
+##  dplyr          0.7.4      2017-09-28 CRAN (R 3.3.2)                    
+##  evaluate       0.10.1     2017-06-24 CRAN (R 3.3.2)                    
+##  ggalluvial   * 0.9.0      2018-06-26 local (corybrunson/ggalluvial@NA) 
+##  ggplot2      * 2.2.1.9000 2018-06-26 Github (tidyverse/ggplot2@348b26f)
+##  glue           1.2.0      2017-10-29 CRAN (R 3.3.2)                    
+##  graphics     * 3.3.3      2017-03-07 local                             
+##  grDevices    * 3.3.3      2017-03-07 local                             
+##  grid           3.3.3      2017-03-07 local                             
+##  gtable         0.2.0      2016-02-26 CRAN (R 3.3.0)                    
+##  htmltools      0.3.6      2017-04-28 cran (@0.3.6)                     
+##  knitr          1.18       2017-12-27 CRAN (R 3.3.2)                    
+##  labeling       0.3        2014-08-23 CRAN (R 3.3.0)                    
+##  lazyeval       0.2.1      2017-10-29 cran (@0.2.1)                     
+##  magrittr       1.5        2014-11-22 CRAN (R 3.3.0)                    
+##  memoise        1.1.0      2017-04-21 CRAN (R 3.3.2)                    
+##  methods      * 3.3.3      2017-03-07 local                             
+##  munsell        0.4.3      2016-02-13 CRAN (R 3.3.0)                    
+##  pillar         1.1.0      2018-01-14 CRAN (R 3.3.3)                    
+##  pkgconfig      2.0.1      2017-03-21 CRAN (R 3.3.2)                    
+##  plyr           1.8.4      2016-06-08 CRAN (R 3.3.0)                    
+##  purrr          0.2.4      2017-10-18 cran (@0.2.4)                     
+##  R6             2.2.2      2017-06-17 cran (@2.2.2)                     
+##  RColorBrewer   1.1-2      2014-12-07 CRAN (R 3.3.0)                    
+##  Rcpp           0.12.17    2018-05-18 CRAN (R 3.3.3)                    
+##  rlang          0.2.0.9001 2018-06-26 Github (tidyverse/rlang@ba4fb06)  
+##  rmarkdown      1.8        2017-11-17 CRAN (R 3.3.2)                    
+##  rprojroot      1.3-2      2018-01-03 CRAN (R 3.3.3)                    
+##  scales         0.5.0.9000 2018-06-18 Github (hadley/scales@4056ec3)    
+##  stats        * 3.3.3      2017-03-07 local                             
+##  stringi        1.2.2      2018-05-02 CRAN (R 3.3.3)                    
+##  stringr        1.2.0      2017-02-18 CRAN (R 3.3.2)                    
+##  tibble         1.4.2      2018-01-22 CRAN (R 3.3.3)                    
+##  tidyr          0.7.2      2017-10-16 CRAN (R 3.3.2)                    
+##  tidyselect     0.2.3      2017-11-06 CRAN (R 3.3.2)                    
+##  tools          3.3.3      2017-03-07 local                             
+##  utils        * 3.3.3      2017-03-07 local                             
+##  withr          2.1.2      2018-06-26 Github (jimhester/withr@fe56f20)  
+##  yaml           2.1.19     2018-05-01 CRAN (R 3.3.3)

diff --git a/docs/articles/labels.html b/docs/articles/labels.html index d2297fa0..17ac1f06 100644 --- a/docs/articles/labels.html +++ b/docs/articles/labels.html @@ -245,54 +245,54 @@

## tz America/New_York ## date 2018-06-26
## Packages -----------------------------------------------------------------
-
##  package    * version    date       source                                
-##  assertthat   0.2.0      2017-04-11 cran (@0.2.0)                         
-##  backports    1.1.2      2017-12-13 CRAN (R 3.3.2)                        
-##  base       * 3.3.3      2017-03-07 local                                 
-##  bindr        0.1.1      2018-03-13 CRAN (R 3.3.3)                        
-##  bindrcpp     0.2.2      2018-03-29 CRAN (R 3.3.3)                        
-##  colorspace   1.3-2      2016-12-14 CRAN (R 3.3.2)                        
-##  datasets   * 3.3.3      2017-03-07 local                                 
-##  devtools     1.13.5     2018-02-18 CRAN (R 3.3.3)                        
-##  digest       0.6.15     2018-01-28 CRAN (R 3.3.3)                        
-##  dplyr        0.7.4      2017-09-28 CRAN (R 3.3.2)                        
-##  evaluate     0.10.1     2017-06-24 CRAN (R 3.3.2)                        
-##  ggalluvial * 0.9.0      2018-06-26 local (corybrunson/ggalluvial@ca234a6)
-##  ggfittext    0.5.0.9003 2018-01-15 Github (wilkox/ggfittext@50021c0)     
-##  ggplot2    * 2.2.1.9000 2018-06-26 Github (tidyverse/ggplot2@348b26f)    
-##  ggrepel      0.7.0      2017-09-29 CRAN (R 3.3.2)                        
-##  glue         1.2.0      2017-10-29 CRAN (R 3.3.2)                        
-##  graphics   * 3.3.3      2017-03-07 local                                 
-##  grDevices  * 3.3.3      2017-03-07 local                                 
-##  grid         3.3.3      2017-03-07 local                                 
-##  gtable       0.2.0      2016-02-26 CRAN (R 3.3.0)                        
-##  htmltools    0.3.6      2017-04-28 cran (@0.3.6)                         
-##  knitr        1.18       2017-12-27 CRAN (R 3.3.2)                        
-##  labeling     0.3        2014-08-23 CRAN (R 3.3.0)                        
-##  lazyeval     0.2.1      2017-10-29 cran (@0.2.1)                         
-##  magrittr     1.5        2014-11-22 CRAN (R 3.3.0)                        
-##  memoise      1.1.0      2017-04-21 CRAN (R 3.3.2)                        
-##  methods    * 3.3.3      2017-03-07 local                                 
-##  munsell      0.4.3      2016-02-13 CRAN (R 3.3.0)                        
-##  pillar       1.1.0      2018-01-14 CRAN (R 3.3.3)                        
-##  pkgconfig    2.0.1      2017-03-21 CRAN (R 3.3.2)                        
-##  plyr         1.8.4      2016-06-08 CRAN (R 3.3.0)                        
-##  purrr        0.2.4      2017-10-18 cran (@0.2.4)                         
-##  R6           2.2.2      2017-06-17 cran (@2.2.2)                         
-##  Rcpp         0.12.17    2018-05-18 CRAN (R 3.3.3)                        
-##  rlang        0.2.0.9001 2018-06-26 Github (tidyverse/rlang@ba4fb06)      
-##  rmarkdown    1.8        2017-11-17 CRAN (R 3.3.2)                        
-##  rprojroot    1.3-2      2018-01-03 CRAN (R 3.3.3)                        
-##  scales       0.5.0.9000 2018-06-18 Github (hadley/scales@4056ec3)        
-##  stats      * 3.3.3      2017-03-07 local                                 
-##  stringi      1.2.2      2018-05-02 CRAN (R 3.3.3)                        
-##  stringr      1.2.0      2017-02-18 CRAN (R 3.3.2)                        
-##  tibble       1.4.2      2018-01-22 CRAN (R 3.3.3)                        
-##  tidyr        0.7.2      2017-10-16 CRAN (R 3.3.2)                        
-##  tidyselect   0.2.3      2017-11-06 CRAN (R 3.3.2)                        
-##  tools        3.3.3      2017-03-07 local                                 
-##  utils      * 3.3.3      2017-03-07 local                                 
-##  withr        2.1.2      2018-06-26 Github (jimhester/withr@fe56f20)      
+
##  package    * version    date       source                            
+##  assertthat   0.2.0      2017-04-11 cran (@0.2.0)                     
+##  backports    1.1.2      2017-12-13 CRAN (R 3.3.2)                    
+##  base       * 3.3.3      2017-03-07 local                             
+##  bindr        0.1.1      2018-03-13 CRAN (R 3.3.3)                    
+##  bindrcpp     0.2.2      2018-03-29 CRAN (R 3.3.3)                    
+##  colorspace   1.3-2      2016-12-14 CRAN (R 3.3.2)                    
+##  datasets   * 3.3.3      2017-03-07 local                             
+##  devtools     1.13.5     2018-02-18 CRAN (R 3.3.3)                    
+##  digest       0.6.15     2018-01-28 CRAN (R 3.3.3)                    
+##  dplyr        0.7.4      2017-09-28 CRAN (R 3.3.2)                    
+##  evaluate     0.10.1     2017-06-24 CRAN (R 3.3.2)                    
+##  ggalluvial * 0.9.0      2018-06-26 local (corybrunson/ggalluvial@NA) 
+##  ggfittext    0.5.0.9003 2018-01-15 Github (wilkox/ggfittext@50021c0) 
+##  ggplot2    * 2.2.1.9000 2018-06-26 Github (tidyverse/ggplot2@348b26f)
+##  ggrepel      0.7.0      2017-09-29 CRAN (R 3.3.2)                    
+##  glue         1.2.0      2017-10-29 CRAN (R 3.3.2)                    
+##  graphics   * 3.3.3      2017-03-07 local                             
+##  grDevices  * 3.3.3      2017-03-07 local                             
+##  grid         3.3.3      2017-03-07 local                             
+##  gtable       0.2.0      2016-02-26 CRAN (R 3.3.0)                    
+##  htmltools    0.3.6      2017-04-28 cran (@0.3.6)                     
+##  knitr        1.18       2017-12-27 CRAN (R 3.3.2)                    
+##  labeling     0.3        2014-08-23 CRAN (R 3.3.0)                    
+##  lazyeval     0.2.1      2017-10-29 cran (@0.2.1)                     
+##  magrittr     1.5        2014-11-22 CRAN (R 3.3.0)                    
+##  memoise      1.1.0      2017-04-21 CRAN (R 3.3.2)                    
+##  methods    * 3.3.3      2017-03-07 local                             
+##  munsell      0.4.3      2016-02-13 CRAN (R 3.3.0)                    
+##  pillar       1.1.0      2018-01-14 CRAN (R 3.3.3)                    
+##  pkgconfig    2.0.1      2017-03-21 CRAN (R 3.3.2)                    
+##  plyr         1.8.4      2016-06-08 CRAN (R 3.3.0)                    
+##  purrr        0.2.4      2017-10-18 cran (@0.2.4)                     
+##  R6           2.2.2      2017-06-17 cran (@2.2.2)                     
+##  Rcpp         0.12.17    2018-05-18 CRAN (R 3.3.3)                    
+##  rlang        0.2.0.9001 2018-06-26 Github (tidyverse/rlang@ba4fb06)  
+##  rmarkdown    1.8        2017-11-17 CRAN (R 3.3.2)                    
+##  rprojroot    1.3-2      2018-01-03 CRAN (R 3.3.3)                    
+##  scales       0.5.0.9000 2018-06-18 Github (hadley/scales@4056ec3)    
+##  stats      * 3.3.3      2017-03-07 local                             
+##  stringi      1.2.2      2018-05-02 CRAN (R 3.3.3)                    
+##  stringr      1.2.0      2017-02-18 CRAN (R 3.3.2)                    
+##  tibble       1.4.2      2018-01-22 CRAN (R 3.3.3)                    
+##  tidyr        0.7.2      2017-10-16 CRAN (R 3.3.2)                    
+##  tidyselect   0.2.3      2017-11-06 CRAN (R 3.3.2)                    
+##  tools        3.3.3      2017-03-07 local                             
+##  utils      * 3.3.3      2017-03-07 local                             
+##  withr        2.1.2      2018-06-26 Github (jimhester/withr@fe56f20)  
 ##  yaml         2.1.19     2018-05-01 CRAN (R 3.3.3)

diff --git a/docs/articles/labels_files/figure-html/ggrepel-1.png b/docs/articles/labels_files/figure-html/ggrepel-1.png index 6aa97c1b..1c645bf1 100644 Binary files a/docs/articles/labels_files/figure-html/ggrepel-1.png and b/docs/articles/labels_files/figure-html/ggrepel-1.png differ diff --git a/docs/reference/self-adjoin.html b/docs/reference/self-adjoin.html index aa37cbea..73ce0a1b 100644 --- a/docs/reference/self-adjoin.html +++ b/docs/reference/self-adjoin.html @@ -160,7 +160,7 @@

Examp major_changes <- self_adjoin(majors, key = semester, by = "student", link = c("semester", "curriculum")) major_changes$change <- major_changes$curriculum.x == major_changes$curriculum.y -head(major_changes)
#> pair student semester.x curriculum.x semester.y curriculum.y change +head(major_changes)
#> step student semester.x curriculum.x semester.y curriculum.y change #> 1 1 1 CURR1 Painting CURR3 Painting TRUE #> 2 1 2 CURR1 Painting CURR3 Painting TRUE #> 3 1 6 CURR1 Sculpure CURR3 Sculpure TRUE @@ -172,7 +172,7 @@

Examp vaccination_steps <- self_adjoin(vaccinations, key = survey, by = "subject", link = c("survey", "response"), keep.x = c("freq", "a")) -head(vaccination_steps)

#> pair subject survey.x response.x survey.y response.y freq a +head(vaccination_steps)
#> step subject survey.x response.x survey.y response.y freq a #> 1 1 1 ms153_NSA Always ms432_NSA Always 48 0.050367261 #> 2 1 2 ms153_NSA Always ms432_NSA Always 9 0.009443861 #> 3 1 3 ms153_NSA Always ms432_NSA Missing 66 0.069254984 @@ -181,7 +181,7 @@

Examp #> 6 1 6 ms153_NSA Always ms432_NSA Never 1 0.001049318

vaccination_steps <- self_adjoin(vaccinations, key = survey, by = "subject", link = c("survey", "response"), keep.x = c("freq", "a"), keep.y = "a") -head(vaccination_steps)
#> pair subject survey.x response.x survey.y response.y freq a.x +head(vaccination_steps)
#> step subject survey.x response.x survey.y response.y freq a.x #> 1 1 1 ms153_NSA Always ms432_NSA Always 48 0.050367261 #> 2 1 2 ms153_NSA Always ms432_NSA Always 9 0.009443861 #> 3 1 3 ms153_NSA Always ms432_NSA Missing 66 0.069254984