From 36aebc5c6e56422d4e2f3512d1eb702d5d12ba1b Mon Sep 17 00:00:00 2001 From: Magnus Dehli Vigeland Date: Fri, 25 Feb 2022 21:30:01 +0100 Subject: [PATCH] Fixed CRAN error; bump to 1.4.1 --- DESCRIPTION | 2 +- R/familias2ped.R | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cf80399..1362e36 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: forrel Title: Forensic Pedigree Analysis and Relatedness Inference -Version: 1.4.0 +Version: 1.4.1 Authors@R: c( person("Magnus Dehli", "Vigeland", , "m.d.vigeland@medisin.uio.no", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9134-4962")), diff --git a/R/familias2ped.R b/R/familias2ped.R index 75a6c6e..700967f 100644 --- a/R/familias2ped.R +++ b/R/familias2ped.R @@ -59,12 +59,12 @@ Familias2ped = function(familiasped, datamatrix, loci, matchLoci = FALSE) { ### If first argument is a list of FamiliasPedigrees, convert one at a time. - if (is.list(familiasped) && class(familiasped[[1]]) == "FamiliasPedigree") { + if (is.list(familiasped) && inherits(familiasped[[1]], "FamiliasPedigree")) { res = lapply(familiasped, function(p) Familias2ped(p, datamatrix = datamatrix, loci = loci, matchLoci = matchLoci)) return(res) } - else if(class(familiasped) != "FamiliasPedigree") + else if(!inherits(familiasped, "FamiliasPedigree")) stop2("The first argument must be a `FamiliasPedigree` or a list of such") @@ -157,7 +157,7 @@ Familias2ped = function(familiasped, datamatrix, loci, matchLoci = FALSE) { readFamiliasLoci = function(loci) { if (is.null(loci)) return(NULL) - if (class(loci) == "FamiliasLocus") + if (inherits(loci, "FamiliasLocus")) loci = list(loci) lapply(loci, function(a) {