Learn R Programming

capm (version 0.14.0)

PlotImmigrationFlow: Plot immigration flows

Description

Plot rimmigration flows from many sources to one destination.

Usage

PlotImmigrationFlow(data = NULL, source = NULL, destination = NULL,
  n.sources = 5, agg.sources.prefix = "Other ",
  agg.sources.suffix = " sources", cls = NULL, start.degree = 0,
  sources.label.dist = 0.15, sources.label.size = 0.75,
  ticks.label.size = 0.7)

Arguments

data

data.frame with sources and destination.

source

data's column name or index with places' names. Sources' names and destination's name must be in this column.

destination

destination's name.

n.sources

number of sources to plot. If smaller than the total number of sources source, the less frequent sources are aggregated.

agg.sources.prefix

string. If n.sources is smaller than the total number of sources, agg.sources.prefix is used to label the aggregated sources.

agg.sources.suffix

character. If n.sources is smaller than the total number of sources, agg.sources.prefix is used to label the aggregated sources.

cls

Optional character vector with n.sources + 1 colors.

start.degree

The starting degree from which the circle begins to draw. It is passed to the start.degree argumento of circlize::circos.par function.

sources.label.dist

Data point on y-axis to separate the sources' labels from the circle. It is passed to the y argument of circlize::circos.text function.

sources.label.size

Font size for sources' labels. It is passed to the cex argument of circlize::circos.text function.

ticks.label.size

Font size for sources' labels. It is passed to the labels.cex argument of circlize::circos.axis function.

Details

The numbers arround the circle indicate the number of animals.

References

Gu, Z. (2014) circlize implements and enhances circular visualization in R. Bioinformatics. DOI: 10.1093/bioinformatics/btu393

Baquero, O. S., Marconcin, S., Rocha, A., & Garcia, R. D. C. M. (2018). Companion animal demography and population management in Pinhais, Brazil. Preventive Veterinary Medicine.

http://oswaldosantos.github.io/capm

Examples

Run this code
# NOT RUN {
data(dogs)
cls <- c("blue3", "orange", "skyblue", "darkgreen", "yellow3", "black")
PlotImmigrationFlow(dogs, "acquisition_city", "Pinhais",
                    cls = cls, agg.sources.suffix = " cities")

# }

Run the code above in your browser using DataLab