diff --git a/.Rbuildignore b/.Rbuildignore index cb0953f..31a9a74 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,6 +3,7 @@ ^LICENSE\.md$ ^R/\.Rhistory$ ^R/paper$ +CITATION.cff$ ^doc$ ^data-raw$ ^Meta$ diff --git a/DESCRIPTION b/DESCRIPTION index f547d85..17c3eee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,34 +1,47 @@ Package: BGmisc Title: An R Package for Extended Behavior Genetics Analysis Version: 1.2.0 -URL: https://github.com/R-Computing-Lab/BGmisc/, https://r-computing-lab.github.io/BGmisc/ -BugReports: https://github.com/R-Computing-Lab/BGmisc/issues -Authors@R: - c(person("S. Mason", "Garrison", email = "garrissm@wfu.edu", role = c("aut", "cre"), comment=c(ORCID = "0000-0002-4804-6003")), - person(c("Michael", "D."), "Hunter", role = "aut", comment=c(ORCID = "0000-0002-3651-6709")), - person("Xuanyu", "Lyu", role = "aut", comment=c(ORCID = "0000-0002-2841-5529")), - person(c("Rachel", "N."), "Good", role = "aut", comment=c(ORCID = "0000-0000-0000-0000")), - person(c("Jonathan", "D."), "Trattner", role = "aut", comment=c(ORCID = "0000-0002-1097-7603")), - person(c("S.", "Alexandra"), "Burt", role = "aut", comment=c(ORCID = "0000-0001-5538-7431")) +Authors@R: c( + person("S. Mason", "Garrison", , "garrissm@wfu.edu", role = c("aut", "cre"), + comment = c(ORCID = "0000-0002-4804-6003")), + person(c("Michael", "D."), "Hunter", role = "aut", + comment = c(ORCID = "0000-0002-3651-6709")), + person("Xuanyu", "Lyu", role = "aut", + comment = c(ORCID = "0000-0002-2841-5529")), + person(c("Rachel", "N."), "Good", role = "aut", + comment = c(ORCID = "0000-0000-0000-0000")), + person(c("Jonathan", "D."), "Trattner", role = "aut", + comment = c(ORCID = "0000-0002-1097-7603")), + person(c("S.", "Alexandra"), "Burt", role = "aut", + comment = c(ORCID = "0000-0001-5538-7431")) ) -Description: The BGmisc R package offers a comprehensive suite of functions tailored for extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation, and more. +Description: The BGmisc R package offers a comprehensive suite of + functions tailored for extended behavior genetics analysis, including + model identification, calculating relatedness, pedigree conversion, + pedigree simulation, and more. License: GPL-3 -Encoding: UTF-8 -LazyData: true -RoxygenNote: 7.3.1 +URL: https://github.com/R-Computing-Lab/BGmisc/, + https://r-computing-lab.github.io/BGmisc/ +BugReports: https://github.com/R-Computing-Lab/BGmisc/issues +Depends: + R (>= 3.5.0) Imports: - Matrix, - stats, + igraph, kinship2, - igraph + Matrix, + stats Suggests: - knitr, - rmarkdown, + dplyr, EasyMx, + knitr, OpenMx, - dplyr, + rmarkdown, + rticles, testthat (>= 3.0.0) -VignetteBuilder: knitr +VignetteBuilder: + knitr Config/testthat/edition: 3 -Depends: - R (>= 3.5.0) +Encoding: UTF-8 +LazyData: true +RoxygenNote: 7.3.1 +Language: en-US diff --git a/R/checkIDs.R b/R/checkIDs.R index d8ce3a8..c4a2357 100644 --- a/R/checkIDs.R +++ b/R/checkIDs.R @@ -4,7 +4,7 @@ #' 1. Checks for the uniqueness of individual IDs. #' 2. Optionally repairs non-unique IDs based on a specified logic. #' -#' @param ped A dataframe representing the pedigree data with columns 'ID', 'dadID', and 'momID'. +#' @param ped A dataframe representing the pedigree data with columns `ID`, `dadID`, and `momID`. #' @param verbose A logical flag indicating whether to print progress and validation messages to the console. #' @param repair A logical flag indicating whether to attempt repairs on non-unique IDs. #' diff --git a/R/dataDoc.R b/R/dataDoc.R index 88b4002..bc622bc 100755 --- a/R/dataDoc.R +++ b/R/dataDoc.R @@ -55,7 +55,7 @@ NULL ##' \item DA2. Binary variable signifying the fundamental unknowability of existence ##' \item birthYr. Birth year for person ##' \item onsetYr. Year of onset for person -##' \item deathYr. Death year for person +##' \item \code{deathYr}. Death year for person ##' \item available. logical. Whether ##' \item Gen. Generation of the person ##' \item proband. logical. Whether the person is a proband or not diff --git a/R/tweakPedigree.R b/R/tweakPedigree.R index a974e94..03447d7 100644 --- a/R/tweakPedigree.R +++ b/R/tweakPedigree.R @@ -7,7 +7,7 @@ #' @param ID_twin2 A vector of \code{ID} of the second twin. #' @param verbose logical. If TRUE, print progress through stages of algorithm #' @param gen_twin A vector of \code{generation} of the twin to be imputed. -#' @return Returns a \code{data.frame} with MZ twins infomration added as a new column. +#' @return Returns a \code{data.frame} with MZ twins information added as a new column. #' @export # A function to impute twins in the simulated pedigree \code{data.frame}. @@ -226,15 +226,15 @@ makeInbreeding <- function(ped, #' dropLink #' A function to drop a person from his/her parents in the simulated pedigree \code{data.frame}. -#' The person can be dropped by specifying his/her ID or by specifying the generation which the randomly to be dropeed person is in. -#' The function can separate one pedigree into two pedigrees. Seperating into small pieces should be done by running the function multiple times. +#' The person can be dropped by specifying his/her ID or by specifying the generation which the randomly to-be-dropped person is in. +#' The function can separate one pedigree into two pedigrees. Separating into small pieces should be done by running the function multiple times. #' This is a supplementary function for \code{simulatePedigree}. #' @param ped a pedigree simulated from simulatePedigree function or the same format #' @param ID_drop the ID of the person to be dropped from his/her parents. -#' @param gen_drop the generation in which the randomly dropped person is. Will work if ID_drop is not specified. +#' @param gen_drop the generation in which the randomly dropped person is. Will work if `ID_drop` is not specified. #' @param sex_drop the biological sex of the randomly dropped person. #' @param n_drop the number of times the mutation happens. -#' @return a pedigree with the dropped person's dadID and momID set to NA. +#' @return a pedigree with the dropped person's `dadID` and `momID` set to NA. #' @export dropLink <- function(ped, ID_drop = NA_integer_, diff --git a/dev/config_attachment.yaml b/dev/config_attachment.yaml new file mode 100644 index 0000000..46e24ec --- /dev/null +++ b/dev/config_attachment.yaml @@ -0,0 +1,12 @@ +path.n: NAMESPACE +path.d: DESCRIPTION +dir.r: R +dir.v: vignettes +dir.t: tests +extra.suggests: ~ +pkg_ignore: ~ +document: yes +normalize: yes +inside_rmd: no +must.exist: yes +check_if_suggests_is_installed: yes diff --git a/man/hazard.Rd b/man/hazard.Rd index 8a29f3b..7dd9503 100755 --- a/man/hazard.Rd +++ b/man/hazard.Rd @@ -28,7 +28,7 @@ The variables are as follows: \item DA2. Binary variable signifying the fundamental unknowability of existence \item birthYr. Birth year for person \item onsetYr. Year of onset for person - \item deathYr. Death year for person + \item \code{deathYr}. Death year for person \item available. logical. Whether \item Gen. Generation of the person \item proband. logical. Whether the person is a proband or not diff --git a/man/makeTwins.Rd b/man/makeTwins.Rd index 1458db8..8d9701f 100644 --- a/man/makeTwins.Rd +++ b/man/makeTwins.Rd @@ -27,7 +27,7 @@ makeTwins( \item{verbose}{logical. If TRUE, print progress through stages of algorithm} } \value{ -Returns a \code{data.frame} with MZ twins infomration added as a new column. +Returns a \code{data.frame} with MZ twins information added as a new column. } \description{ makeTwins diff --git a/vignettes/modelingrelatedness.Rmd b/vignettes/modelingrelatedness.Rmd index 7275134..a719302 100644 --- a/vignettes/modelingrelatedness.Rmd +++ b/vignettes/modelingrelatedness.Rmd @@ -119,7 +119,7 @@ run1 <- emxTwinModel( summary(run1) ``` -As you can see the model was unsucessful because it was not identified. But when we add another group, so that the model is identified, the model now fits. +As you can see the model was unsuccessful because it was not identified. But when we add another group, so that the model is identified, the model now fits. ```{r} run2 <- emxTwinModel( diff --git a/vignettes/modelingrelatedness.html b/vignettes/modelingrelatedness.html index 32291ad..0429b9e 100644 --- a/vignettes/modelingrelatedness.html +++ b/vignettes/modelingrelatedness.html @@ -485,10 +485,10 @@

Using identifyComponentModel Function

#> AIC: -5917.148 -3685.148 -3685.078 #> BIC: -10747.543 -3667.773 -3680.471 #> To get additional fit indices, see help(mxRefModels) -#> timestamp: 2023-09-07 10:37:41 -#> Wall clock time: 0.07050681 secs +#> timestamp: 2024-02-25 14:31:03 +#> Wall clock time: 0.06564403 secs #> optimizer: SLSQP -#> OpenMx version number: 2.21.8 +#> OpenMx version number: 2.21.11 #> Need help? See help(mxSummary)

As you can see the model was unsucessful because it was not identified. But when we add another group, so that the model is @@ -524,10 +524,10 @@

Using identifyComponentModel Function

#> AIC: -9113.092 -5499.092 -5499.048 #> BIC: -17811.437 -5479.794 -5492.498 #> To get additional fit indices, see help(mxRefModels) -#> timestamp: 2023-09-07 10:37:41 -#> Wall clock time: 0.04858994 secs +#> timestamp: 2024-02-25 14:31:03 +#> Wall clock time: 0.05463982 secs #> optimizer: SLSQP -#> OpenMx version number: 2.21.8 +#> OpenMx version number: 2.21.11 #> Need help? See help(mxSummary) diff --git a/vignettes/network.Rmd b/vignettes/network.Rmd index 002aee7..3b5d0c0 100644 --- a/vignettes/network.Rmd +++ b/vignettes/network.Rmd @@ -157,7 +157,7 @@ table(extendedFamilyEnvironment) # Subsetting Pedigrees -Subsetting a pedigree allows researchers to focus on specific family lines or individuals within a larger dataset. This can be particularly useful for data validation as well as simplifying complex pedigrees for visualization. However, subsetting a pedigree can result in the underestimation of relatedness between individuals. This is because the subsetted pedigree may not contain all the individuals that connect two people together. For example if we were to remove Arthur Weasley (person 9) and Molly Prewett (person 10) from the `potter` dataset, we would lose the connections amoungst their children. +Subsetting a pedigree allows researchers to focus on specific family lines or individuals within a larger dataset. This can be particularly useful for data validation as well as simplifying complex pedigrees for visualization. However, subsetting a pedigree can result in the underestimation of relatedness between individuals. This is because the subsetted pedigree may not contain all the individuals that connect two people together. For example if we were to remove Arthur Weasley (person 9) and Molly Prewett (person 10) from the `potter` dataset, we would lose the connections amongst their children. ```{r, echo=FALSE, results='hide', out.width='50%', fig.cap="Potter Subset Pedigree"} @@ -173,9 +173,9 @@ plotPedigree(subset_potter, code_male = 1, verbose = TRUE) In the plot above, we have removed Arthur Weasley (person 9) and Molly Prewett (person 10) from the `potter` dataset. As a result, the connections between their children are lost. -Similarly, if we remove the children of Vernon Dursey (1) and Petunia Evans(3) from the `potter` dataset, we would lose the connections between the two individuals. +Similarly, if we remove the children of Vernon Dursey (1) and Petunia Evans (3) from the `potter` dataset, we would lose the connections between the two individuals. -However, this subset does not plot the relationship between spouses (such as the marriage between ), as there are not children to connect the two individuals together yet. +However, this subset does not plot the relationship between spouses (such as the marriage between Vernon Dursey and Petunia Evans), as there are not children to connect the two individuals together yet. ```{r} subset_rows <- c(1:5, 31:36) diff --git a/vignettes/pedigree.html b/vignettes/pedigree.html index 0b13234..edc6f3d 100644 --- a/vignettes/pedigree.html +++ b/vignettes/pedigree.html @@ -416,7 +416,7 @@

Single Pedigree Visualization

plotPedigree() function.

# Plot the simulated pedigree
 plotPedigree(df_ped)
-

+

#> Did not plot the following people: 10032
 #> $plist
 #> $plist$n
@@ -598,7 +598,7 @@ 

Visualizing Multiple Pedigrees Side-by-Side

# Plot the 4-generation pedigree plotPedigree(df_ped_4, width = 1)
-

+

#> $plist
 #> $plist$n
 #> [1]  2  5 10 12