uncooked_spaghetti {CKMRpop}R Documentation

Summarise kin-pair information and use it to create uncooked spaghetti plots


This gives a nice graphical summary of all the kin pairs along with when they were sampled and their age at the time of sampling and their sex. #' In order to visually summarize all the kin pairs that were found, with specific reference to their age, time of sampling, and sex, I find it helpful to use what I have named the "Uncooked Spaghetti Plot". There are multiple subpanels on this plot. Here is how to read/view these plots:


uncooked_spaghetti(Pairs, Samples, jitter_age = 0.2, jitter_year = 0.2)



The tibble of kin pairs that comes out of compile_related_pairs().


The tibble of samples that comes out of slurp_spip().


half the width of the uniform jitter window around age


half the width of the uniform jitter window around sampling year


uncooked_spaghetti() returns a list with two components: input_data and plot. plot is a ggplot object of the plot described above in "Description." input_data is, itself, another list with the following named components:


# get the input variables
# only take the first 50 samples to reduce time for example
Samples <- species_1_slurped_results$samples[1:50, ]
Pairs <- compile_related_pairs(Samples)
result <- uncooked_spaghetti(Pairs, Samples)

# produce the plot with:
# result$plot

[Package CKMRpop version 0.1.3 Index]