You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I have implemented the feature you described. The pie_size argument now accepts a single value or a vector of values the same length as the number of sites. This allows users to plot pies of different sizes for different sites.
Example:
library(mapmixture)
# Admixture Format 1
file <- system.file("extdata", "admixture1.csv", package = "mapmixture")
admixture1 <- read.csv(file)
# Coordinates Format
file <- system.file("extdata", "coordinates.csv", package = "mapmixture")
coordinates <- read.csv(file)
# Plot using a single value
mapmixture(admixture1, coordinates, pie_size = 1)
mapmixture(admixture1, coordinates, pie_size = 1, crs = 3035)
# Plot using a vector of values
pie_radius <- c(1,2,1,3,1,1,1,1,1,1)
mapmixture(admixture1, coordinates, pie_size = pie_radius)
mapmixture(admixture1, coordinates, pie_size = pie_radius, crs = 3035)
You will also get an informative warning if you input an incorrect number of pie radius values:
> mapmixture(admixture1, coordinates, pie_size = c(1,2,3), crs = 3035)
Error in mapmixture(admixture1, coordinates, pie_size = c(1, 2, 3), crs = 3035) :
Invalid input: pie_size vector must be of length 1 or the same length as the number of sites
Please let me know if this is OK. It will be part of the next release of mapmixture to CRAN. For now, to use this feature download the latest development version from GitHub:
Hello,
Thanks for the tool, is there a way to scale the radius of the pies so they are proportional to a value for each location e.g. rpkm?
Cheers!
The text was updated successfully, but these errors were encountered: