Skip to content

Commit

Permalink
update mig_chord
Browse files Browse the repository at this point in the history
  • Loading branch information
guyabel committed Feb 19, 2024
1 parent 85a8fb5 commit b6b8f90
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 86 deletions.
2 changes: 2 additions & 0 deletions .Rhistory
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ roxygen2::roxygenise()
pkgdown::build_site()
?usethis::use_github_action_check_standard
usethis::use_github_action_check_standard()
roxygen2::roxygenise()
roxygen2::roxygenise()
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# migest 2.0.5

* Added `labels.pos.adjust = FALSE` in `mig_chord()`
* Default colour ordering in `mig_chord()` based on `union(.$orig, .$dest)`

# migest 2.0.4

* Direct demo users to `mig_chord()` pkgdown site
Expand Down
8 changes: 5 additions & 3 deletions R/mig_chord.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ mig_chord <- function(
dest = 2,
flow = 3) %>%
sum_region() %>%
{if(is.null(z$order)) . else dplyr::mutate(., region = factor(region, levels = z$order))} %>%
{if(is.null(z$order)) . else dplyr::arrange(., region)} %>%
{if(is.null(z$order)) dplyr::mutate(., region = factor(region, levels = union(x[[1]], x[[2]]))) else dplyr::mutate(., region = factor(region, levels = z$order))} %>%
dplyr::arrange(., region) %>%
dplyr::mutate(col = grDevices::colorRampPalette(migest::umbrella)(nrow(.))) %>%
{if(is.null(z$grid.col)) . else dplyr::mutate(., col = z$grid.col)} %>%
dplyr::select(region, col) %>%
tibble::deframe()
# pie(rep(1, length(xx)), col = xx, labels = names(xx))
}

if(!is.null(z$grid.col) & !is.null(z$order)){
Expand Down Expand Up @@ -215,7 +216,7 @@ mig_chord <- function(
panel.fun = function(x, y) {
if(is.null(axis_breaks))
circlize::circos.axis(h = "bottom", labels.cex = axis_size,
labels.niceFacing = FALSE)
labels.niceFacing = FALSE, labels.pos.adjust = FALSE)
# do.call(what = circlize::circos.axis, args = y)
if(!is.null(axis_breaks)){
# if(is.null(y$major.at))
Expand All @@ -226,6 +227,7 @@ mig_chord <- function(
mm <- max(z$xmax)*2
circlize::circos.axis(
h = "bottom", labels.cex = axis_size, labels.niceFacing = FALSE,
labels.pos.adjust = FALSE,
major.at = seq(from = 0, to = mm, by = axis_breaks)
)
}
Expand Down
1 change: 0 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ knitr::opts_chunk$set(
[![CRAN status](https://www.r-pkg.org/badges/version/migest)](https://CRAN.R-project.org/package=migest)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/migest?color=blue)](https://r-pkg.org/pkg/migest)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R-CMD-check](https://github.com/guyabel/migest/workflows/R-CMD-check/badge.svg)](https://github.com/guyabel/migest/actions)
[![R-CMD-check](https://github.com/guyabel/migest/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/guyabel/migest/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ status](https://www.r-pkg.org/badges/version/migest)](https://CRAN.R-project.org
downloads](https://cranlogs.r-pkg.org/badges/grand-total/migest?color=blue)](https://r-pkg.org/pkg/migest)
[![Lifecycle:
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R-CMD-check](https://github.com/guyabel/migest/workflows/R-CMD-check/badge.svg)](https://github.com/guyabel/migest/actions)
[![R-CMD-check](https://github.com/guyabel/migest/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/guyabel/migest/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

<img src='https://raw.githubusercontent.com/guyabel/migest/master/hex/logo_transp.png' align="right" height="200" style="float:right; height:200px;"/>
Expand Down
28 changes: 14 additions & 14 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ figures:
fig.width: 7.2916667
fig.height: 7.2916667
reference:
- title: "Migration data summaries"
- title: "Data summaries"
- contents:
- sum_bilat
- sum_region
Expand All @@ -29,35 +29,35 @@ reference:
- contents:
- mig_chord
- str_wrap_n
- title: "Flows from stocks estimation methods"
- contents:
- starts_with("ffs")
- title: "Migration indices"
- title: "Indices"
- contents:
- starts_with("index")
- title: "Creating special matrices"
- title: "Estimation: flows from stocks"
- contents:
- block_matrix
- stripe_matrix
- title: "Constrained maximisation routines"
- starts_with("ffs")
- title: "Estimation: constrained maximisation routines"
- contents:
- starts_with("cm")
- title: "Iterative proportional fitting procedures"
- title: "Estimation: iterative proportional fitting procedures"
- contents:
- ipf2
- ipf3
- ipf2_block
- ipf2_stripe
- title: "Net migration estimation methods"
- title: "Estimation: net migration"
- contents:
- starts_with("net")
- title: "Rogers Castro model age schedule parameters"
- contents:
- starts_with("rc")
- title: "Rescaling functions"
- contents:
- rescale_net
- rescale_integer_sum
- title: "Rogers Castro model age schedule parameters"
- contents:
- starts_with("rc")
- title: "Creating special matrices"
- contents:
- block_matrix
- stripe_matrix
- title: "Miscellaneous"
- contents:
- quadratic_eqn
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pandoc: 3.1.1
pkgdown: 2.0.7
pkgdown_sha: ~
articles: {}
last_built: 2024-02-03T02:21Z
last_built: 2024-02-19T02:02Z

Binary file modified docs/reference/Rplot002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 41 additions & 41 deletions docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/ipumsi_age.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/reference/mig_chord-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/mig_chord-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/mig_chord-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/mig_chord-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions docs/reference/rescale_integer_sum.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b6b8f90

Please sign in to comment.