diff --git a/README.Rmd b/README.Rmd index 140ad3b..78ed78d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -52,28 +52,29 @@ x = halfSibPed(type = "paternal") # Make 5 female x = swapSex(x, 5) -# Add 6 as a sister to 5 -x = addChildren(x, father = 2, mother = 3, nch = 1, sex = 2) +# Add a sister to 5 (parents are 2 and 3) +x = addDaughter(x, parents = 2:3) # Add inbred child -x = addChildren(x, father = 4, mother = 5, nch = 1) +x = addSon(x, parents = 4:5) # Create marker -m = marker(x, "7" = "a/b", alleles = c("a", "b")) +x = addMarker(x, "7" = "a/b") # Plot pedigree with genotypes -plot(x, marker = m, hatched = 7) +plot(x, marker = 1, hatched = 7) ``` ```{r example, echo = FALSE, fig.height = 3, fig.width = 3.5, out.width = "40%"} -plot(x, marker = m, hatched = 7, margin = c(1,1,1,1)) +plot(x, marker = 1, hatched = 7, margin = c(1,1,1,1)) ``` The process of building pedigrees is perfectly suited for the pipe operator `|>` recently introduced in R. For example, the above pedigree could have been created as follows: ```{r, eval = FALSE} x = halfSibPed(type = "paternal") |> swapSex(5) |> - addChildren(father = 2, mother = 3, nch = 1, sex = 2) |> - addChildren(father = 4, mother = 5, nch = 1) + addDaughter(parents = 2:3) |> + addSon(parents = 4:5) |> + addMarker("7" = "a/b") ``` For details about what **pedtools** can do, and many other examples, [the vignette](https://cran.r-project.org/package=pedtools/vignettes/pedtools.html) is a good place to start. diff --git a/README.md b/README.md index 26755b3..edb8c00 100644 --- a/README.md +++ b/README.md @@ -62,17 +62,17 @@ x = halfSibPed(type = "paternal") # Make 5 female x = swapSex(x, 5) -# Add 6 as a sister to 5 -x = addChildren(x, father = 2, mother = 3, nch = 1, sex = 2) +# Add a sister to 5 (parents are 2 and 3) +x = addDaughter(x, parents = 2:3) # Add inbred child -x = addChildren(x, father = 4, mother = 5, nch = 1) +x = addSon(x, parents = 4:5) # Create marker -m = marker(x, "7" = "a/b", alleles = c("a", "b")) +x = addMarker(x, "7" = "a/b") # Plot pedigree with genotypes -plot(x, marker = m, hatched = 7) +plot(x, marker = 1, hatched = 7) ``` @@ -84,8 +84,9 @@ could have been created as follows: ``` r x = halfSibPed(type = "paternal") |> swapSex(5) |> - addChildren(father = 2, mother = 3, nch = 1, sex = 2) |> - addChildren(father = 4, mother = 5, nch = 1) + addDaughter(parents = 2:3) |> + addSon(parents = 4:5) |> + addMarker("7" = "a/b") ``` For details about what **pedtools** can do, and many other examples, diff --git a/man/figures/README-example-1.png b/man/figures/README-example-1.png index c1e868e..3ff2343 100644 Binary files a/man/figures/README-example-1.png and b/man/figures/README-example-1.png differ