Skip to content

simtrait

Simulate Complex Traits from Genotypes

v1.1.3 · Jan 6, 2023 · GPL-3

Description

Simulate complex traits given a SNP genotype matrix and model parameters (the desired heritability, number of causal loci, and either the true ancestral allele frequencies used to generate the genotypes or the mean kinship for a real dataset). Emphasis on avoiding common biases due to the use of estimated allele frequencies. The code selects random loci to be causal, constructs coefficients for these loci and random independent non-genetic effects, and can optionally generate random group effects. Traits can follow three models: random coefficients, fixed effect sizes, and infinitesimal (multivariate normal). GWAS method benchmarking functions are also provided. Described in Yao and Ochoa (2022) <doi:10.1101/2022.03.25.485885>.

Downloads

CRAN

252

Last 30 days

19616th

575

Last 90 days

2.6K

Last year

Trend: +88.1% (30d vs prior 30d)

r2u CRAN

0

Last 30 days

23

Last 90 days

95

Last year

Trend: -100% (30d vs prior 30d)

autoCRAN

2

Last 7 days

16

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Code

Structure

Lines of code

3,902

Files

45

Compiled share

0%

Has compiled src

No

Language breakdown

R 1,283 (32.9%)Tests 1,063 (27.2%)Docs 720 (18.5%)Vignettes 836 (21.4%)

API

Exported functions

11

Internal functions

4

Recent export changes

v1.1.0+2 pval_power_calib, pval_type_1_err
v1.0.21+9 allele_freqs, cov_trait, herit_loci +6 more

Testing & CI

Has tests

Yes

Test-to-code ratio

0.83

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

Unsafe pattern score

0

Dep constraint coverage

0%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

System requirements

C++ standard

License

GPL-3

License flags

SPDX valid, OSI approved

History

Versions

3

First release

2021-08-16

Latest release

2023-01-06

Avg cadence

254 days

Cold removal rate

Dep drift

0

LOC over versions

v1.0.21: 3,070 LOCv1.1.0: 3,831 LOCv1.1.3: 3,902 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies PRROC simtrait

Version History

4 tracked
new 1.1.3 Mar 10, 2026
updated 1.1.3 ← 1.1.0 diff Jan 5, 2023
updated 1.1.0 ← 1.0.21 diff Aug 22, 2022
new 1.0.21 Aug 15, 2021