New functions:
matchAll
: Variant of base match()
that returns all positional matches
of x
in table
, instead of only returning the first match. Differs from
base match()
in that the function always errors on any match failures
instead of returning NA
.notDupes
: Works like dupes()
, but only returns values that are not
duplicated.Minor changes:
shell
: Set print
argument to TRUE
by default, rather than
interactive()
, which improves console output during scripts invoked by
Rscript
instead of running directly in an R session.Minor changes:
showHeader
: Improved edge case handling of DFrameList
class.New functions:
dupes
: Return unique values that result in TRUE
via base duplicated
.
See also goalie::isDuplicate
for details.pkgCacheDir
: Return the directory path for a package's file cache.strExtract
: Base R variant of stringi::stri_extract_first
.strExtractAll
: Base R variant of stringi::stri_extract_all
.strMatch
: Base R variant of stringi::stri_match_first
.strMatchAll
: Base R variant of stringi::stri_match_all
.strPad
: Base R variant of stringr::str_pad
.strRemoveEmpty
: Base R variant of stringi::stri_remove_empty
.strReplaceNa
: Base R variant of stringi::stri_replace_na
.strSplit
: Base R variant of stringi::str_split_fixed
.Major changes:
pasteURL
to pasteUrl
.strsplit
to strSplit
(note case).Minor changes:
headtail
: Now returns character instead of printing to the console.matchNested
: Simplified internal code by using lengths
.showSlotInfo
: Reworked internal code.Minor changes:
pasteURL
: Hardened against unwanted recycling, which is allowed in base
paste
but undesirable here. Also added an assert check to ensure that URL
is always returning, containing "://"
. This edge case can happen when
user uses function with protocol
set to "none"
. Also added support for
input of a character vector as the first argument alone, which can be useful
for passing in variables.New functions:
strsplit2
: This function works like base strsplit
but consistently splits
into a character matrix for easier extraction of values. Works like
stringi and stringr variants but designed to be as simple as possible without
requiring a non-base R dependency.Minor changes:
euclidean
: Reworked so that generic no longer requires y
. We have modified
this downstream in the pending DepMapAnalysis package update.New functions:
keepOnlyAtomicCols
: New utility function that removes complex non-atomic
columns (e.g. list
) from a DFrame
or data.frame
class object.Minor changes:
showHeader
: Improved header for S4 DFrame
, which contains rows and
columns. For classes that extend Annotated
but don't support dim
, still
returns legacy length information.forceDetach
function, as it is no longer used in any other
Acid Genomics packages.New functions:
randomString
: Random string generator.Minor changes:
tempdir2
: Now calls randomString
internally to generate a unique
temporary directory that is simpler and performs more consistently across
platforms.Minor changes:
pasteURL
now automatically encodes URLs via utils::URLencode
. This is
helpful for improving consistent handling of complex URLs. We ran into
differences in handling between httr and httr2 for URLs containing spaces.
Note that goalie isURL
will now return FALSE
for non-encoded URLs.New functions:
cpus
: Return the number of total CPUs available.ram
: Return the amount of total or free ram, in GB by default.Minor changes:
initDir
is now vectorized and supports multiple directories.Minor changes:
DFrame
from DataFrame
.New functions:
quietly
function from goalie.New functions:
matchNested
: Match recursively across columns for DataFrame
method, and
per element for list
method. This is very useful for quick matching of
cancer cell line name variants (Cellosaurus) and gene name aliases (HGNC,
NCBI in AcidGenomes).Minor changes:
matchArgsToDoCall
from NAMESPACE
.Minor changes:
requireNamespaces
as a reexport.Minor changes:
requireNamespaces
: Migrated this function to goalie. Still reexporting this
function in the NAMESPACE, but that likely will change with a future update.Minor changes:
minorVersion
in favor of majorMinorVersion
, which improves
legibility. Added asserts against ""
and NA
input. Improved code coverage
and support for input of a major version alone here (e.g. "1"
instead of
"1.0"
).requireNamespaces
instead of requireNamespace
consistently
across the package, to improve error messages.New functions:
euclidean
: Calculate Euclidean distance of two numeric vectors.zscore
: Calculate Z score for an input numeric vector or matrix. Note that
matrix method defaults to row-wise scaling, defined by MARGIN
argument.
This convention is intended to match recommended R defaults, and also to
work as expected with sample (columns) x gene (rows) matrix, commonly used
for gene expression in SummarizedExperiment
class objects.New functions:
truncateString
: Simple utility function that smartly adds ellipsis (...
)
when necessary to a long character string. Don't want to export this as
truncate
, which is defined in base R for connections.Minor changes:
shell
: Improved interactive printing and error message handling. The
function now attempts to automatically handle ~
character, when defined
at the beginning of an argument.Minor changes:
shell
: Added support for env
, which allows for environment variable
definition inside the child process. Refer to processx::run
and system2
for details.Minor changes:
requireNamespaces
: Made error message regarding NAMESPACE
more
informative. Now indicates that user needs to install a missing package.Minor changes:
unlink2
: Added assert check to ensure files and/or directories are
successfully deleted. Calls file.exists
internally, which checks both
files and directories.New functions:
tempdir2
: Temporary directory generator that improves upon base R
tempdir
conventions, ensuring that a new unique directory is created
per call.unlink2
: Hardened variant of unlink
that provides better file system
compatibility with Windows. Function will intentionally error if file or
directory does not exist on disk.Minor changes:
normalizePath
calls, using platform
fsep
for winslash
, similar to conventions used in realpath
. This helps
improve consistency of messages and file path output on Windows.Minor changes:
fileExt
: Added pattern
formal, which lets us override compressed file
handling in other packages.compress
: Improved handling of ZIP files, to no longer rely on internal
setwd
call. Now using withr::with_dir
temporary approach instead.compress
and decompress
: Reformatted internal code to pass lintr checks.forceDetach
: Simplify internal code using a for loop.Map
internally instead of mapply
.New functions:
gitCurrentBranch
and gitDefaultBranch
from r-koopa here.Minor changes:
shell
: Added returnStdout
argument, which helps parse stdout.fileExt
: Added option to override default extPattern
match.Major changes:
Suggests
from Imports
.Minor changes:
Minor changes:
compress
/ decompress
: Simplified default formals and documentation.
User can no longer set remove
or overwrite
globally with
"acid.compress.remove"
or "acid.overwrite"
, respectively.formalsList
from NAMESPACE, in favor of a reworked approach
across packages that previously inherited these values (in development).printString
: Improved and cleaned up documentation.DataFrame
object instead of DFrame
,
where applicable. This requires an update to AcidTest package.compress
: Bug fix for ZIP file compression handling outside of working
directory. Incorrectly used basename
argument internally. Unfortunately
need to change the working directory internally to get this working correctly.Minor changes:
metadataBlacklist
(in favor of metadataDenylist
) and bapply
, which
should only be defined in goalie package.tar
from untils package alongside untar
, for consistency.Minor changes:
parentDirectory
: Added support for handling URLs.New functions:
collapseToPathString
: Previously used internally, now exporting so we can
use in koopa dependency package.New functions:
parentDirectory
(parentDir
): Allows for each return of nested parent
directories, similar to approach used in koopa shell package (parent_dir
).Minor changes:
realpath
: Now keeps track of names, if defined.Minor changes:
shell
Added some more useful options for subprocess handling and logging:
wd
, stdoutFile
, stderrFile
, as well as stderrToStdout
.New functions:
addToPathStart
, addToPathEnd
, removeFromPath
.splitPathString
and
uniquePathString
.Major changes:
shell
: Reworked internal code to handoff to processx::run
instead of using
base::system2
. Simplified console output handling using a single print
argument.Minor changes:
abort
instead of stop
internally.New functions:
simpleClass
: Added utility function for simple class checks, primarily
intended for unit testing with testthat package.Minor changes:
standardizeCall
: Updated handling of dots handoff to match.call
in R 4.1.median
and quantile
functions from AcidGenerics, which use
S4 defined in IRanges, rather than the base version defined in stats.Minor changes:
data
and median
as reexports.Minor changes:
install.packages
as a reexport, which is used by r-koopa.head
and tail
as reexports.Minor changes:
metadataBlacklist
in favor of metadataDenylist
.Minor changes:
printString
back here from goalie package.showHeader
now checks for packageVersion
inside of metadata as default
instead of version
.Minor changes:
URLencode
from utils, which is used downstream in Cellosaurus
package.Minor changes:
formula
and untar
as reexports, which are used in the
WormBase package.Minor changes:
download.file
as a reexport from utils.Minor changes:
Major changes:
geometricMean
and sem
methods from basejump.showHeader
from basejump.coerceToList
from basejump.Minor changes:
matchArgsToDoCall
function defunct. Doesn't always evaluate arguments
correctly when called inside nested functions or complex S4 stacks.New functions:
classContains
utility function.Minor changes:
pasteURL
: Added support for rsync as a protocol. Using this in future
update in AcidGenomes package for downloading from UCSC server.Minor changes:
sampleId
from metadataBlacklist
global.pasteURL
now supports "s3" as a protocol value.Minor changes:
Major changes:
Minor changes:
download
: Function now recursively creates destination file parent directory
if necessary.pasteURL
: Now defaulting to no protocol (e.g. "https") by default. This
makes pasting of an existing URL with subdirectories easier.New functions:
download
, which acts as a hardened wrapper for utils::download.file
.
Annoying, download.file
returns status codes but does not intentionally
error on any unsuccessful downloads. Our wrapper ensures that R always errors
on any file download issue. It also sets a longer timeout internally, to
avoid any potential issues with the timeout
option being defined in
Rprofile
.compress
and decompress
were found to potentially generate integer
overflow warnings on very large files, due to R using 32-bit integers.
This issue has been resolving by ensuring the internal nbytes
counter
is set as numeric
instead. See related
Stack Overflow post for
details on integer overflows in R.sem
: Requires AsIs
class support, to work inside dplyr summarize calls.AsIs
S4 class, which
is an oldClass
of the S3 class.New functions:
sem
: Added support for standard error of the mean calculation.New functions:
headtail
atomic, matrix, and data.frame methods here from basejump.
The methods that work on S4 objects, such as DataFrame, Matrix, GRanges,
and SummarizedExperiment are still defined in basejump.showSlotInfo
: Migrated from basejump, so we can use in AcidGenomes.New functions:
forceDetach
, previously used internally inside basejump.Major changes:
Minor changes:
formalsList
to consolidate params from basejump.Minor changes:
realpath
file path resolution using ..
.Major changes:
parseArgs
and positionalArgs
out of package.Minor changes:
Minor changes:
formalsList
: Added acid.import.make.names
global.Minor changes:
positionalArgs
: Function now intentionally errors when no positional
arguments are defined.Minor changes:
shell
: The args
argument has been changed to ""
by default so that
only command
argument is required as input.New functions:
majorVersion
, minorVersion
, sanitizeVersion
: Additional version utilites
that help extraction major and minor release versions. sanitizeVersion
helps
strip extra characters at the end of version strings commonly found in the
return of some shell commands (e.g. via --version
command).shell
: Wrapper for base system2
function.New functions:
parseArgs
and positionalArgs
: Migrated these functions previously defined
inside koopa shell bootloader package.requireNamespaces
: Parameterized variant of requireNamespace
that allows
for easy loading of multiple package namespaces in a single call.Minor changes:
New functions:
compress
, decompress
: Added dynamic file compression/decompression support
for GZ, BZ2, XZ, and ZIP files. Inspired by approach used in R.utils
compressFile
and decompressFile
.Minor changes:
fileDepth
: Updated unit test to work reliably on macOS.Minor changes:
standardizeCall
: Removed extra unnecessary assert check.New functions:
fileDepth
function.Minor changes:
realpath
from brio package. Reworked slightly to not depend on any
assert checks from goalie package. Now this function essentially wraps
normalizePath
but provides a more informative error message.basenameSansExt
: Minor tweak to ensure that files without an extension still
return basename as expected.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.