diff -Nru admisc-0.33/DESCRIPTION admisc-0.34/DESCRIPTION --- admisc-0.33/DESCRIPTION 2023-06-30 21:30:13.000000000 +0000 +++ admisc-0.34/DESCRIPTION 2023-12-08 18:50:08.000000000 +0000 @@ -1,5 +1,5 @@ Package: admisc -Version: 0.33 +Version: 0.34 Title: Adrian Dusa's Miscellaneous Authors@R: person(given = "Adrian", family = "Dusa", role = c("aut", "cre", "cph"), @@ -24,8 +24,8 @@ URL: https://github.com/dusadrian/admisc BugReports: https://github.com/dusadrian/admisc/issues NeedsCompilation: yes -Packaged: 2023-06-30 17:58:23 UTC; dusadrian +Packaged: 2023-12-08 11:19:26 UTC; dusadrian Author: Adrian Dusa [aut, cre, cph] () Maintainer: Adrian Dusa Repository: CRAN -Date/Publication: 2023-06-30 21:30:13 UTC +Date/Publication: 2023-12-08 18:50:08 UTC diff -Nru admisc-0.33/MD5 admisc-0.34/MD5 --- admisc-0.33/MD5 2023-06-30 21:30:13.000000000 +0000 +++ admisc-0.34/MD5 2023-12-08 18:50:08.000000000 +0000 @@ -1,8 +1,9 @@ -cf5fe1c1274245974db74692733029c7 *DESCRIPTION -3511bd814121a6d8149fb94d1399159a *NAMESPACE +2469301763183b17b8fd33c5ea77c9da *DESCRIPTION +546b1ee13cba27b215db87822d0ecbfd *NAMESPACE bc977c0b69e29b95929d93bf919cf7c1 *R/asNumeric.R 5a1d6f86ebdc37bf64343b88b3982f6c *R/asSOP.R 84b5077c51635a655ba9d6f0e9190b4a *R/brackets.R +113240fa7f2005caf248be21466594fd *R/change.R 7bc6ff50e3b5aab50300cd2b5711648e *R/checkMV.R d7a5410351d602458ceb1479b1941b0f *R/checkSubset.R 5dc1d3e7d7608b8954ae02f97160a6b7 *R/checkValid.R @@ -10,20 +11,19 @@ 5198c661bdc9fec77bccfa6611467765 *R/coerceMode.R b71f0c3dddedd4c6086dc6ba40745214 *R/combnk.R 23b21d59957acd9004c8c4f06010faed *R/compute.R -cb3cfd7904a3a394e16b95185fb6d48e *R/dashes.R bc19f1f0e54a7ab2934f5636b69612d1 *R/dimnames.R da849d09281e10b34ef66be703a13c06 *R/equality.R -038f4631794f86db80bdac81f78c0221 *R/expand.R +fd2c96d59515525babc380f8a751dac5 *R/expand.R 120d1da16fbec76d038f0e1638fb3bf1 *R/export.R f5cfe1483fdce3827dd2be53e03d2f41 *R/factorize.R 460bfbed4cf16cd564bca5830d367a16 *R/finvert.R a29a8df68e9332f7542bc079240295f7 *R/frelevel.R -0e2ffc95f2aea1815b42deea02fab467 *R/getInfo.R -85ae2de692073d58b093268ce67b4e27 *R/getLevels.R +4f463f8e21097cb93620ffbe32a7cc07 *R/getInfo.R +5609bbb36ce886d3a0fb683268299c15 *R/getLevels.R 13f858b8d5ba4e0d23da95564980da1f *R/getMatrix.R 1c3110e339e5f753f2d397e129277d9b *R/getName.R 676960e0f5f61606c9285f88beab12ea *R/hclr.R -635c0d089b5d13a35723ad9408b4e30e *R/inside.R +e59467696e9f7c87ebf8f458fc022e23 *R/inside.R 455bceca90ee0590a278cb3fe4323234 *R/intersection.R afd09b1804a5ddab9791a47f7c548dde *R/invert.R a66d1e6105134451ce493781ae848918 *R/listRDA.R @@ -32,6 +32,7 @@ ed7dccdddfe80e85928a0c1ed2c7ba16 *R/numdec.R e7a4ccf033ef6320ade5964576040b9e *R/objRDA.R 92c7638902a55b9fd5a3b46272653ae5 *R/onLoad.R +c0b1bb6ace05feecb9d621cda5808ab3 *R/overwrite.R 80876e01257f6d7768f39bfb9d04bae6 *R/pad.R 3a6a0094af2298f820df50cdcc81dc95 *R/permutations.R 28900aa48583a7633be6998159dad080 *R/possibleNumeric.R @@ -39,33 +40,35 @@ b3b7d736f5f79a275c975710db79defa *R/prettyTable.R 7346a262b4b8a8fc877dc1d9cfeb85e6 *R/print.R 15e0c702d3a8cb8ae32f93166d0f1212 *R/recode.R -ed41bf68db0ce2c0e9068fec8a3937e2 *R/recreate.R +e492f7842fed69c8c3fb2c8d622b9981 *R/recreate.R 81e9197e9cea258610601fa1aa284a91 *R/reload.R 47ac0e18f1e148400ae6293013a288e8 *R/replaceText.R c759846e9cb241769505ac30758b5362 *R/scan.clipboard.R -9b4e1c99da0f84782d265aab8570ee1a *R/simplify.R +1a91dc4d90a8c7c8902418c2bbee69a6 *R/simplify.R f679f20cdef467e85dead6c6ed76cfcc *R/sortExpressions.R -0af9e1faf0dec2045645a9c57e9da102 *R/stopError.R +ce8fb720a6026da93eb969cc880fa2ec *R/stopError.R 6caf1b2a545f6dfd67fd5734c909811d *R/string.R ee4e07f81e454f0bec575efa7c31e215 *R/tagged.R -49c748e31f16622514461c15a3156c9d *R/tildae.R -05893e760dc5972f277e09ca06831947 *R/translate.R +d251fcb287f1dd94b3cb19c7fcad6ec6 *R/tilde.R +237fedc18f27b80a253ee5dc5d1acde5 *R/translate.R 64a61c76e5e09ee1d81a12c48c2926c1 *R/tryCatchWEM.R +c1be8b1f55a0ed4813bebb4b32f365e9 *R/unicode.R df88f90f602ca32d1bdeeadc1a269c56 *R/uninstall.R 6429cbec872583f5ac447b0169fcbf1a *R/unload.R 3b35ec0eeefd182e22df1ac7815f664e *R/unlockEnvironment.R 5d0d1d77d0fbd62e76cecce60d4ddf5b *R/using.R 989bf3822aca9f0e6db3f04f33c2d222 *R/validateNames.R -8acd00e3821e704f9ffcf0b06eef6647 *R/verify.R -22906dbab9a899a1e97d7c56f580ce74 *R/wholeNumeric.R +25a08ea66832757e043ff3aee5eab9ba *R/verify.R +98fe956a085af6eceec0b4efa0f1a980 *R/wholeNumeric.R 80e1eb821affbadce81f5df17bc2ce4e *R/write.clipboard.R 6aa21fd2618d985c140fbf3f69f5596f *R/writePrimeimp.R -439bf689fa27cf9affd0335332142165 *build/partial.rdb -01c8b4e4719b660e24f5f09b6d0c5adc *inst/ChangeLog +8faf250d78a120ba4c7ea2186efddd24 *build/partial.rdb +abb5b4efc9ff966802982c888b8fd456 *inst/ChangeLog 210724e3bcdc7f5a6339a175e8c430d3 *man/SOPexpression.Rd -e16efbb5e0f1b792f8799b2416d9e484 *man/admisc_internal.Rd -fa2a9c009fa1226390dc5e518142e270 *man/admisc_package.Rd +dbdf5e1b6b760600a2c718819c9aacd9 *man/admisc_internal.Rd +9f780d909cc45aa21671b29312e255ba *man/admisc_package.Rd 9f627319f85a2c1b9cef397ea4cf4dfc *man/brackets.Rd +c1997e6df09148be1c4642cbf601c7f9 *man/change.Rd 2e2d468d88a4bac7461d5b571019cdf3 *man/clipboard.Rd e1dc81ec1f3e307e9a2ba4cb424767b7 *man/coerceMode.Rd 6d29a4eb6fd2b09b29ea90ddf24ab41e *man/combnk.Rd @@ -75,19 +78,20 @@ 2a6a41d16a8350f315eab35d329d679e *man/factorize.Rd b88eafdc4fa0297b3ea509ef5def0f19 *man/finvert.Rd aa29f9722645a38b9cdc2ed88cfbe0a9 *man/frelevel.Rd -08cb92bdb7a97631d9af2cf7827e151a *man/getName.Rd +75989985fb8801054e27721b385e3264 *man/getName.Rd 5e9d411c2b8392f00b025c0b66356b93 *man/hclr.Rd b22cd24b5de9ac8a685c4d1223ad33c3 *man/inside.Rd a518151e751acbb73712e0c6f3b397e8 *man/intersection.Rd 626eafe7997b2facf89289c602fb6c8a *man/negate.Rd e3ab2ae5163ad71856cf66453459a9de *man/numdec.Rd 8518107d9379eb475fefe71f869ca6eb *man/numerics.Rd +56e3fd7225f59e14f0446ccbce438f55 *man/overwrite.Rd 427bb8c7134df056ec054e7469ae9547 *man/permutations.Rd c6d08db7c59e5f02461c5883742e643c *man/rdaFunctions.Rd 83d540cbadbfcade3ec80357cf53ab2f *man/recode.Rd b20e04561d6e27574a8365f5fb5ade14 *man/recreate.Rd 40e4109decf2b76c543b0b624cdaad88 *man/replaceText.Rd -b06f4effa03d817ac784ffcf4e04f0a7 *man/tildae.Rd +b388bee93bbdcdbae7a0852ec236cf99 *man/tilde.Rd 98cd7dcd7d0294db9fdce960076fe640 *man/tryCatchWEM.Rd d96ee1b3a789493a5a442ae47e71e03e *man/using.Rd 8289996b878c81f8a0c13fcfb7d8bdad *src/admisc.c diff -Nru admisc-0.33/NAMESPACE admisc-0.34/NAMESPACE --- admisc-0.33/NAMESPACE 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/NAMESPACE 2023-12-08 11:19:25.000000000 +0000 @@ -19,6 +19,7 @@ roundBrackets, squareBrackets, expandBrackets, + change, checkMV, checkSubset, classify, @@ -27,6 +28,7 @@ compute, mvSOP, dashes, + doublequotes, expand, export, factorize, @@ -54,6 +56,7 @@ prettyTable, deMorgan, objRDA, + overwrite, negate, numdec, recode, @@ -69,7 +72,9 @@ setDimnames, setRownames, simplify, + singlequotes, sop, + spaces, splitstr, sortExpressions, stopError, @@ -85,7 +90,7 @@ write.clipboard, writePrimeimp, unlockEnvironment, - + splitMainComponents, splitBrackets, removeSingleStars, @@ -107,6 +112,7 @@ S3method(print, "admisc_simplify") S3method(print, "admisc_fobject") +S3method(change, default) S3method(recode, default) S3method(recode, declared) S3method(asNumeric, default) @@ -116,3 +122,4 @@ S3method(inside, list) S3method(using, default) S3method(using, data.frame) +S3method(change, QCA_tt) diff -Nru admisc-0.33/R/change.R admisc-0.34/R/change.R --- admisc-0.33/R/change.R 1970-01-01 00:00:00.000000000 +0000 +++ admisc-0.34/R/change.R 2023-12-08 11:19:25.000000000 +0000 @@ -0,0 +1,91 @@ +# Copyright (c) 2019 - 2023, Adrian Dusa +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, in whole or in part, are permitted provided that the +# following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * The names of its contributors may NOT be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ADRIAN DUSA BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +`change` <- function(x, ...) { + UseMethod("change") +} +`change.default` <- function(x, ...) { + return(x) +} +`change.QCA_tt` <- function(x, ...) { + metacall <- match.call(expand.dots = TRUE) + callargs <- as.list(metacall[-1]) + dots <- list(...) + if (!requireNamespace("QCA", quietly = TRUE)) { + enter <- ifelse(isFALSE(dots$enter), "", "\n") + message( + paste( + enter, + "Error: Package QCA is needed to change a truth table.", + enter, + sep = "" + ) + ) + return(invisible(character(0))) + } + nullargs <- sapply(callargs, is.null) + nullnms <- names(nullargs)[nullargs] + if (any(nullargs)) { + callargs <- callargs[!nullargs] + } + if (length(callargs) == 1 & length(nullnms) == 0) { + return(x) + } + calls <- sapply(callargs, is.call) + if (any(calls)) { + for (i in which(calls)) { + callist <- as.list(callargs[[i]]) + if (as.character(callist[[1]]) == "findRows") { + if (is.null(callist$obj)) { + callist$obj <- callargs$x + callargs[[i]] <- as.call(callist) + } + } + } + } + callist <- as.list(x$call) + ttname <- as.character(callargs[["x"]]) + for (i in seq(2, length(callist))) { + callist[[i]] <- admisc::recreate(callist[[i]]) + } + callist$data <- x$initial.data + if (length(callargs) > 1) { + for (i in seq(2, length(callargs))) { + callargs[[i]] <- admisc::recreate(callargs[[i]]) + } + for (nm in names(callargs)[-1]) { + callist[[nm]] <- callargs[[nm]] + } + } + if (length(nullnms) > 0) { + for (nm in nullnms) { + callist[[nm]] <- NULL + } + } + x <- do.call("truthTable", callist[-1]) + callist$data <- ttname + x$call <- as.call(callist) + return(x) +} diff -Nru admisc-0.33/R/dashes.R admisc-0.34/R/dashes.R --- admisc-0.33/R/dashes.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/dashes.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -# Copyright (c) 2019 - 2023, Adrian Dusa -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, in whole or in part, are permitted provided that the -# following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * The names of its contributors may NOT be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL ADRIAN DUSA BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -`dashes` <- function() { - return(c("\u002d", "\u2013")) -} diff -Nru admisc-0.33/R/expand.R admisc-0.34/R/expand.R --- admisc-0.33/R/expand.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/expand.R 2023-12-08 11:19:25.000000000 +0000 @@ -28,7 +28,6 @@ expression <- recreate(substitute(expression)) snames <- recreate(substitute(snames)) dots <- list(...) - enter <- ifelse(is.element("enter", names(dots)), "", "\n") multivalue <- FALSE scollapse <- ifelse(is.element("scollapse", names(dots)), dots$scollapse, FALSE) scollapse <- scollapse | grepl("[*]", expression) diff -Nru admisc-0.33/R/getInfo.R admisc-0.34/R/getInfo.R --- admisc-0.33/R/getInfo.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/getInfo.R 2023-12-08 11:19:25.000000000 +0000 @@ -23,20 +23,23 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`getInfo` <- function(data) { +`getInfo` <- function(data, ...) { + dots <- list(...) if (is.matrix(data)) { data <- as.data.frame(data) } dc.code <- unique(unlist(lapply(data, function(x) { - if (is.numeric(x)) { + if (is.numeric(x) && wholeNumeric(x)) { return(x[x < 0]) } else { return(as.character(x[is.element(x, c("-", "dc"))])) } }))) - if (length(dc.code) > 1) { - stopError("Multiple \"don't care\" codes found.") + if (!isTRUE(dots$no_column_info)) { + if (length(dc.code) > 1) { + stopError("Multiple \"don't care\" codes found.") + } } fuzzy.cc <- logical(ncol(data)) hastime <- logical(ncol(data)) @@ -51,7 +54,7 @@ if (is.factor(cc)) { cc <- as.character(cc) } - if (length(dc.code) > 0 && is.element(dc.code, cc)) { + if (length(dc.code) > 0 && any(is.element(cc, dc.code))) { cc[is.element(cc, dc.code)] <- -1 } if (possibleNumeric(cc)) { diff -Nru admisc-0.33/R/getLevels.R admisc-0.34/R/getLevels.R --- admisc-0.33/R/getLevels.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/getLevels.R 2023-12-08 11:19:25.000000000 +0000 @@ -26,13 +26,13 @@ `getLevels` <- function(data) { data <- as.data.frame(data) colnames <- paste("V", ncol(data), sep = ".") - pN <- unlist(lapply(data, possibleNumeric)) + pN <- sapply(data, possibleNumeric) noflevels <- rep(NA, ncol(data)) ulevels <- rep(NA, ncol(data)) noflevels[pN] <- apply( data[, pN, drop = FALSE], 2, - max + function(x) max(as.numeric(x)) ) + 1 ulevels <- apply( data, @@ -48,7 +48,7 @@ apply( data[, pN, drop = FALSE], 2, - function(x) any(x %% 1 > 0) + function(x) any(as.numeric(x) %% 1 > 0) ) ] <- 2 if (any(factor | declared)) { diff -Nru admisc-0.33/R/inside.R admisc-0.34/R/inside.R --- admisc-0.33/R/inside.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/inside.R 2023-12-08 11:19:25.000000000 +0000 @@ -37,7 +37,16 @@ del <- setdiff(names(data), nl) data[nl] <- l data[del] <- NULL - parent[[dataname]] <- data + if (exists(dataname, parent)) { + parent[[dataname]] <- data + } + else { + structure_string <- paste(capture.output(dput(data)), collapse = " ") + eval( + parse(text = sprintf(paste(dataname, "<- %s"), structure_string)), + envir = parent + ) + } } `inside.list` <- function(data, expr, keepAttrs = TRUE, ...) { parent <- parent.frame() @@ -50,8 +59,17 @@ del <- setdiff(names(data), nl) data[nl] <- l data[del] <- NULL - parent[[dataname]] <- data } else { - parent[[dataname]] <- as.list(e, all.names=TRUE) + data <- as.list(e, all.names=TRUE) + } + if (exists(dataname, parent)) { + parent[[dataname]] <- data + } + else { + structure_string <- paste(capture.output(dput(data)), collapse = " ") + eval( + parse(text = sprintf(paste(dataname, "<- %s"), structure_string)), + envir = parent + ) } } diff -Nru admisc-0.33/R/overwrite.R admisc-0.34/R/overwrite.R --- admisc-0.33/R/overwrite.R 1970-01-01 00:00:00.000000000 +0000 +++ admisc-0.34/R/overwrite.R 2023-12-08 11:19:26.000000000 +0000 @@ -0,0 +1,38 @@ +# Copyright (c) 2019 - 2023, Adrian Dusa +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, in whole or in part, are permitted provided that the +# following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * The names of its contributors may NOT be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ADRIAN DUSA BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +`overwrite` <- function(objname, content, environment) { + objname <- gsub("'|\"|[[:space:]]", "", objname) + if (exists(objname, environment)) { + environment[[objname]] <- content + } + else { + structure_string <- paste(capture.output(dput(content)), collapse = " ") + eval( + parse(text = sprintf(paste(objname, "<- %s"), structure_string)), + envir = environment + ) + } +} diff -Nru admisc-0.33/R/recreate.R admisc-0.34/R/recreate.R --- admisc-0.33/R/recreate.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/recreate.R 2023-12-08 11:19:26.000000000 +0000 @@ -99,7 +99,7 @@ if (identical(classes[i], "list")) { if (is.element("function", unlist(lapply(result[[i]], class)))) { result[[i]] <- dxlist[[i]] - } + } } } } @@ -119,7 +119,13 @@ if (identical(class(x), "<-")) { return(withinobj(dx)) } - x <- tryCatch(eval(x, envir = parent.frame(n = 2)), error = function(e) withinobj(dx)) + x <- tryCatch( + eval( + x, + envir = parent.frame(n = 2) + ), + error = function(e) withinobj(dx) + ) if (identical(class(x), "formula")) { return(withinobj(dx)) } diff -Nru admisc-0.33/R/simplify.R admisc-0.34/R/simplify.R --- admisc-0.33/R/simplify.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/simplify.R 2023-12-08 11:19:26.000000000 +0000 @@ -28,7 +28,7 @@ snames <- recreate(substitute(snames)) dots <- list(...) mvregexp <- "\\[|\\]|\\{|\\}" - enter <- if (is.element("enter", names(dots))) "" else "\n" + enter <- if (is.element("enter", names(dots))) dots$enter else "\n" all.sol <- if (is.element("all.sol", names(dots))) dots$all.sol else FALSE scollapse <- if (is.element("scollapse", names(dots))) dots$scollapse else FALSE if (identical(snames, "")) { @@ -53,7 +53,7 @@ } } implicants <- expand(expression, snames = snames, noflevels = noflevels, - enter = enter, implicants = TRUE) + implicants = TRUE) if (identical(unclass(implicants), "")) { return(implicants) } diff -Nru admisc-0.33/R/stopError.R admisc-0.34/R/stopError.R --- admisc-0.33/R/stopError.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/stopError.R 2023-12-08 11:19:26.000000000 +0000 @@ -25,7 +25,6 @@ `stopError` <- function(message, enter = "\n", ...) { dots <- list(...) - prenter <- ifelse(is.element("prenter", names(dots)), dots$prenter, TRUE) message <- paste0( "Error: ", unlist( @@ -42,7 +41,7 @@ ) ) } - if (prenter) { + if (!isFALSE(dots$prenter)) { cat(enter) } stop( diff -Nru admisc-0.33/R/tildae.R admisc-0.34/R/tildae.R --- admisc-0.33/R/tildae.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/tildae.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -# Copyright (c) 2019 - 2023, Adrian Dusa -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, in whole or in part, are permitted provided that the -# following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * The names of its contributors may NOT be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL ADRIAN DUSA BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -`tildae` <- function() { - return(c("\u007e", "\u223c", "\u00ac", "\u223d")) -} -`tilde1st` <- function(x) { - is.element( - substring( - gsub( - paste0("[[:space:]|", "\u00a0", "]"), - "", - x - ), - 1, 1 - ), - tildae() - ) -} -`hastilde` <- function(x) { - grepl(paste(tildae(), collapse = "|"), x) -} -`notilde` <- function(x) { - gsub( - paste(tildae(), collapse = "|"), - "", - gsub( - paste0("[[:space:]|", "\u00a0", "]"), - "", - x - ) - ) -} diff -Nru admisc-0.33/R/tilde.R admisc-0.34/R/tilde.R --- admisc-0.33/R/tilde.R 1970-01-01 00:00:00.000000000 +0000 +++ admisc-0.34/R/tilde.R 2023-12-08 11:19:26.000000000 +0000 @@ -0,0 +1,52 @@ +# Copyright (c) 2019 - 2023, Adrian Dusa +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, in whole or in part, are permitted provided that the +# following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * The names of its contributors may NOT be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ADRIAN DUSA BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +`tilde1st` <- function(x) { + is.element( + substring( + gsub( + paste0("[[:space:]|", "\u00a0", "]"), + "", + x + ), + 1, 1 + ), + tildae() + ) +} +`hastilde` <- function(x) { + grepl(paste(tildae(), collapse = "|"), x) +} +`notilde` <- function(x) { + gsub( + paste(tildae(), collapse = "|"), + "", + gsub( + paste0("[[:space:]|", "\u00a0", "]"), + "", + x + ) + ) +} diff -Nru admisc-0.33/R/translate.R admisc-0.34/R/translate.R --- admisc-0.33/R/translate.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/translate.R 2023-12-08 11:19:26.000000000 +0000 @@ -23,7 +23,8 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`translate` <- function(expression = "", snames = "", noflevels = NULL, data = NULL, ... +`translate` <- function( + expression = "", snames = "", noflevels = NULL, data = NULL, ... ) { expression <- recreate(substitute(expression)) snames <- recreate(substitute(snames)) @@ -43,7 +44,7 @@ if (any(grepl("<=>|<->|=>|->|<=|<-", expression))) { stopError("Incorrect expression, contains outcome and relation.") } - if (!is.vector(snames)) { + if (!is.vector(drop(snames))) { stopError("Set names should be a single string or a vector of names.") } if (!is.null(data)) { @@ -128,7 +129,7 @@ } if (is.null(noflevels)) { if (!is.null(data)) { - infodata <- getInfo(data) + infodata <- getInfo(data, no_column_info = TRUE) noflevels <- infodata$noflevels } } @@ -176,10 +177,10 @@ ) pp <- unlist(strsplit(expression, split = "[+]")) if (curly) { - conds <- sort(unique(notilde(curlyBrackets(pp, outside=TRUE)))) + conds <- sort(unique(notilde(curlyBrackets(pp, outside = TRUE)))) } else { - conds <- sort(unique(notilde(squareBrackets(pp, outside=TRUE)))) + conds <- sort(unique(notilde(squareBrackets(pp, outside = TRUE)))) } if (identical(snames, "")) { if (!is.null(data)) { @@ -289,7 +290,7 @@ if (!identical(snames, "")) { if (!is.null(data)) { if ( - all(is.element(conds, snames)) & + all(is.element(conds, snames)) & all(is.element(conds, colnames(data))) ) { infodata <- getInfo(data[, conds, drop = FALSE]) diff -Nru admisc-0.33/R/unicode.R admisc-0.34/R/unicode.R --- admisc-0.33/R/unicode.R 1970-01-01 00:00:00.000000000 +0000 +++ admisc-0.34/R/unicode.R 2023-12-08 11:19:26.000000000 +0000 @@ -0,0 +1,40 @@ +# Copyright (c) 2019 - 2023, Adrian Dusa +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, in whole or in part, are permitted provided that the +# following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * The names of its contributors may NOT be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ADRIAN DUSA BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +`dashes` <- function() { + return(c("\u002d", "\u2013")) +} +`tildae` <- function() { + return(c("\u007e", "\u223c", "\u00ac", "\u223d")) +} +`singlequotes` <- function() { + return(c("\u00b4", "\u0060", "\u2018", "\u2019")) +} +`doublequotes` <- function() { + return(c("\u201c", "\u201d")) +} +`spaces` <- function() { + return("\u00a0") +} diff -Nru admisc-0.33/R/verify.R admisc-0.34/R/verify.R --- admisc-0.33/R/verify.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/verify.R 2023-12-08 11:19:26.000000000 +0000 @@ -23,8 +23,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`verify` <- -function(data) { +`verify` <- function(data) { if (is.data.frame(data)) { if (is.null(colnames(data))) { stopError("The dataset doesn't have any columns names.") @@ -77,7 +76,7 @@ stopError(paste(strwrap(errmessage, exdent = 7), collapse = "\n", sep = "")) } } - else if (is.vector(data)) { + else if (is.vector(drop(data))) { if (!possibleNumeric(data)) { stopError("Non numeric input.") } diff -Nru admisc-0.33/R/wholeNumeric.R admisc-0.34/R/wholeNumeric.R --- admisc-0.33/R/wholeNumeric.R 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/R/wholeNumeric.R 2023-12-08 11:19:26.000000000 +0000 @@ -41,7 +41,7 @@ result[!isna & isnax] <- FALSE isna <- isna | isnax x <- x[!isna] - result[!isna] <- floor(x) == x + result[!isna] <- abs(x - round(x)) < .Machine$double.eps^0.5 if (each) { return(result) } Binary files /tmp/tmpqb7577x2/vsMGj3s6U_/admisc-0.33/build/partial.rdb and /tmp/tmpqb7577x2/t5oVhc4RzF/admisc-0.34/build/partial.rdb differ diff -Nru admisc-0.33/debian/changelog admisc-0.34/debian/changelog --- admisc-0.33/debian/changelog 2023-07-08 14:45:38.000000000 +0000 +++ admisc-0.34/debian/changelog 2023-12-24 03:54:42.000000000 +0000 @@ -1,16 +1,23 @@ -admisc (0.33-1cran1.2004.0) focal; urgency=medium +admisc (0.34-1cran1.2004.0) focal; urgency=medium * Compilation for Ubuntu 20.04.6 LTS * Build for c2d4u for R 4.0.0 plus * Focal only build amd64 packages for Launchpad - -- Michael Rutter Sat, 08 Jul 2023 14:45:38 +0000 + -- Michael Rutter Sun, 24 Dec 2023 03:54:42 +0000 + +admisc (0.34-1cran1) testing; urgency=low + + * cran2deb svn: 362M with DB version 1. + + -- cran2deb4ubuntu Mon, 18 Dec 2023 02:38:03 -0500 + admisc (0.33-1cran1) testing; urgency=low * cran2deb svn: 362M with DB version 1. - -- cran2deb4ubuntu Thu, 06 Jul 2023 02:24:21 -0400 + -- cran2deb4ubuntu Thu, 06 Jul 2023 02:24:31 -0400 admisc (0.32-1cran1) testing; urgency=low diff -Nru admisc-0.33/inst/ChangeLog admisc-0.34/inst/ChangeLog --- admisc-0.33/inst/ChangeLog 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/inst/ChangeLog 2023-12-08 11:19:25.000000000 +0000 @@ -1,3 +1,9 @@ +Version 0.34 + o New function overwrite() + o New function change() + o Improved version of inside(), where now the argument "data" can be + anything (including a list component) + Version 0.33 o Minor changes to the internal function getInfo() o Employed hexadecimal representation for replacing special characters @@ -75,19 +81,19 @@ o New function hclr(), to produce colors from the HCL spectrum o New function coerceMode(), to coerce objects to numeric or integer, if at all possible - + Version 0.21 o Bug fix in function negate(), expressions were not properly concatenated (thanks to Alessandra Costa for the report) - + Version 0.20 o New argument "each" in functions possibleNumeric() and wholeNumeric() - + Version 0.19 o New function asSOP(), to coerce a POS expression to a standard SOP format o New function mvSOP(), to coerce an expression from crisp set notation to multi-value notation - + Version 0.18 o Fixed bug affecting the function negate() when the SOP expression contains a single condition in one of the conjuncts / products @@ -96,26 +102,26 @@ "haven_labelled" to be converted as numeric o Improved function stopError(), printing error messages containing newline characters - + Version 0.17 o More robust support for multi-byte locales when detecting tilde and dash operators o Fixed bug in possibleNumeric() for objects of class declared - + Version 0.16 o New functions agtb(), altb() and aneqb() to test (in)equality of floats o New utility function getName() to return the name of the object being used in a function call o Fixed bug when recoding objects of class "declared" o Fixed bug detecting multibyte strings - + Version 0.15 o possibleNumeric() and asNumeric() are now more robust in situations with invalid multibyte strings o Argument "cuts" renamed to "cut" in function recode() o Fixed bug in function recode() that prevented creating ordered factors - + Version 0.12 o Solved bug in function translate() when called from plumber or callr (thanks to Trevor Strobel for the report) @@ -132,17 +138,17 @@ o Improved version of combnk(), to cover input vectors of any type o Improved error trapping for functions negate() and simplify, when dealing with multivalue expressions - + Version 0.10 o Minor, internal functionality changes - + Version 0.9 o Solved bug in translate() recognizing column names for datasets with more than 27 columns (thanks to Sophia Birchinger for the report) o New function export(), moved here from package QCA - + Version 0.8 - o Extended functionality to other types of vectors, such as having the + o Extended functionality to other types of vectors, such as having the class "haven_labelled" o Novel way of recognizing SOP expressions, even without quotes o New utility function recreate() to facilitate substitution @@ -176,7 +182,7 @@ suited in dealing with set names of variable number of characters, including space o As a result, argument "snames" from function venn() can deal with - spaces in set names (thanks to Andre Gohr for the suggestion) + spaces in set names (thanks to Andre Gohr for the suggestion) Version 0.4 o Fixed small printing bug in possibleNumeric() diff -Nru admisc-0.33/man/admisc_internal.Rd admisc-0.34/man/admisc_internal.Rd --- admisc-0.33/man/admisc_internal.Rd 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/man/admisc_internal.Rd 2023-12-08 11:19:25.000000000 +0000 @@ -4,6 +4,7 @@ \alias{checkSubset} \alias{classify} \alias{dashes} +\alias{doublequotes} \alias{expandBrackets} \alias{getInfo} \alias{getLevels} @@ -32,6 +33,8 @@ \alias{solveBrackets} \alias{sortExpressions} \alias{simplifyList} +\alias{singlequotes} +\alias{spaces} \alias{stopError} \alias{tildae} \alias{trimstr} diff -Nru admisc-0.33/man/admisc_package.Rd admisc-0.34/man/admisc_package.Rd --- admisc-0.33/man/admisc_package.Rd 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/man/admisc_package.Rd 2023-12-08 11:19:25.000000000 +0000 @@ -1,6 +1,6 @@ \name{About the admisc package} -\alias{admisc} +\alias{admisc-package} \docType{package} @@ -27,8 +27,8 @@ \tabular{ll}{ Package: \tab admisc\cr Type: \tab Package\cr - Version: \tab 0.33\cr - Date: \tab 2023-06-30\cr + Version: \tab 0.34\cr + Date: \tab 2023-12-08\cr License: \tab GPL (>= 2)\cr } } diff -Nru admisc-0.33/man/change.Rd admisc-0.34/man/change.Rd --- admisc-0.33/man/change.Rd 1970-01-01 00:00:00.000000000 +0000 +++ admisc-0.34/man/change.Rd 2023-12-08 11:19:25.000000000 +0000 @@ -0,0 +1,48 @@ +\name{change} + +\alias{change} + +\title{ +Change the structure of an object, function of the (changed) parameters used to +create it. +} + +\description{ +A generic function that applies different altering methods for different types +of objects (of certain classes). +} + +\usage{ +change(x, ...) +} + +\arguments{ + \item{x}{An object of a particular class.} + \item{...}{Arguments to be passed to a specific method.} +} + +\value{ + The changed object. +} + +\author{ +Adrian Dusa +} + +\examples{ +\dontrun{ +# An example to change a QCA truth table +library(QCA) + +ttLF <- truthTable(LF, outcome = SURV, incl.cut = 0.8) +minimize(ttLF, include = "?") + +# excluding contradictory simplifying assumptions +minimize( + change(ttLF, exclude = findRows(type = 2)), + include = "?" +) +} +} + +\keyword{functions} diff -Nru admisc-0.33/man/getName.Rd admisc-0.34/man/getName.Rd --- admisc-0.33/man/getName.Rd 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/man/getName.Rd 2023-12-08 11:19:25.000000000 +0000 @@ -41,7 +41,7 @@ \examples{ foo <- function(x) { - funargs <- unlist(lapply(match.call(), deparse)[-1]) + funargs <- sapply(match.call(), deparse)[-1] return(getName(funargs[1])) } diff -Nru admisc-0.33/man/overwrite.Rd admisc-0.34/man/overwrite.Rd --- admisc-0.33/man/overwrite.Rd 1970-01-01 00:00:00.000000000 +0000 +++ admisc-0.34/man/overwrite.Rd 2023-12-08 11:19:25.000000000 +0000 @@ -0,0 +1,51 @@ +\name{overwrite} + +\alias{overwrite} + +\title{ +Overwrite an object in a given environment. +} + +\description{ +Utility function to overwrite an object, and bypass the assignment operator. +} + +\usage{ +overwrite(objname, content, environment) +} + +\arguments{ + \item{objname}{Character, the name of the object to overwrite.} + \item{content}{An R object} + \item{environment}{The environment where to perform the overwrite procedure.} +} + +\value{ +This function does not return anything. +} + +\author{ +Adrian Dusa +} + +\examples{ +foo <- function(object, x) { + objname <- deparse(substitute(object)) + object <- x + overwrite(objname, object, parent.frame()) +} + + +bar <- 1 +foo(bar, 2) + +bar +# [1] 2 + +bar <- list(A = bar) +foo(bar$A, 3) + +bar +} + +\keyword{functions} diff -Nru admisc-0.33/man/tildae.Rd admisc-0.34/man/tildae.Rd --- admisc-0.33/man/tildae.Rd 2023-06-30 17:58:23.000000000 +0000 +++ admisc-0.34/man/tildae.Rd 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -\name{Tildae operations} - -\alias{hastilde} -\alias{notilde} -\alias{tilde1st} - -\title{Tildae operations} - -\description{ -Checks and changes expressions containing set negations using a tilde. -} - -\usage{ -hastilde(x) -notilde(x) -tilde1st(x) -} - -\arguments{ - \item{x}{A vector of values} -} - - -\details{ -Boolean expressions can be negated in various ways. For binary crisp and fuzzy sets, one of -the most straightforward ways to invert the set membership scores is to subtract them from 1. -This is both possible using R vectors and also often used to signal a negation in SOP -(sum of products) expressions. - -Some other times, SOP expressions can signal a set negation (also known as the absence of a -causal condition) by using lower case letters, while upper case letters are used to signal -the presence of a causal condition. SOP expressions also use a tilde to signal a set negation, -immediately preceding the set name. - -This set of functions detect when and if a set present in a SOP expression contains a tilde -(function \bold{\code{hastilde}}), whether the entire expression begins with a tilde (function -\bold{\code{tilde1st}}). -} - -\author{ -Adrian Dusa -} - -\examples{ -hastilde("~A") -} - - -\keyword{functions} diff -Nru admisc-0.33/man/tilde.Rd admisc-0.34/man/tilde.Rd --- admisc-0.33/man/tilde.Rd 1970-01-01 00:00:00.000000000 +0000 +++ admisc-0.34/man/tilde.Rd 2023-12-08 11:19:25.000000000 +0000 @@ -0,0 +1,49 @@ +\name{Tilde operations} + +\alias{hastilde} +\alias{notilde} +\alias{tilde1st} + +\title{Tilde operations} + +\description{ +Checks and changes expressions containing set negations using a tilde. +} + +\usage{ +hastilde(x) +notilde(x) +tilde1st(x) +} + +\arguments{ + \item{x}{A vector of values} +} + + +\details{ +Boolean expressions can be negated in various ways. For binary crisp and fuzzy sets, one of +the most straightforward ways to invert the set membership scores is to subtract them from 1. +This is both possible using R vectors and also often used to signal a negation in SOP +(sum of products) expressions. + +Some other times, SOP expressions can signal a set negation (also known as the absence of a +causal condition) by using lower case letters, while upper case letters are used to signal +the presence of a causal condition. SOP expressions also use a tilde to signal a set negation, +immediately preceding the set name. + +This set of functions detect when and if a set present in a SOP expression contains a tilde +(function \bold{\code{hastilde}}), whether the entire expression begins with a tilde (function +\bold{\code{tilde1st}}). +} + +\author{ +Adrian Dusa +} + +\examples{ +hastilde("~A") +} + + +\keyword{functions}