Learn R Programming

⚠️There's a newer version (1.13) of this package.Take me there.

BBmisc (version 1.10)

Miscellaneous Helper Functions for B. Bischl

Description

Miscellaneous helper functions for and from B. Bischl and some other guys at TU Dortmund, mainly for package development.

Copy Link

Version

Install

install.packages('BBmisc')

Monthly Downloads

10,816

Version

1.10

License

BSD_3_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

July 12th, 2016

Functions in BBmisc (1.10)

capitalizeStrings

Capitalize strings in a vector
cFactor

Combine multiple factors and return a factor.
asMatrixCols

Extracts a named element from a list of lists.
addClasses

A wrapper to add to the class attribute.
binPack

Simple bin packing.
checkArg

Check for a function argument.
%btwn%

Check if some values are covered by the range of the values in a second vector.
argsAsNamedList

Parses ... arguments to a named list.
asQuoted

Converts a string into a quoted expression.
catf

Wrapper for cat and sprintf.
convertDataFrameCols

Converts columns in a data frame to characters, factors or numerics.
computeMode

Compute statistical mode of a vector (value that occurs most frequently).
clipString

Shortens strings to a given length.
collapsef

Collapse vector to string.
collapse

Collapse vector to string.
chunk

Chunk elements of vectors into blocks of nearly equal size.
checkListElementClass

Check that a list contains only elements of a required type.
convertIntegers

Conversion for integer vector.
convertInteger

Conversion for single integer.
coalesce

Returns first non-missing, non-null argument.
do.call2

Execute a function call similar to do.call.
convertListOfRowsToDataFrame

Convert a list of row-vectors of equal structure to a data.frame.
convertToShortString

Converts any R object to a descriptive string so it can be used in messages.
ensureVector

Blow up single scalars / objects to vectors / list by replication.
explode

Split up a string into substrings.
deprecated

Deprecated function. Do not use!
convertRowsToList

Convert rows (columns) of data.frame or matrix to lists.
filterNull

Filter a list for NULL values
extractSubList

Extracts a named element from a list of lists.
getRelativePath

Construct a path relative to another
getAttributeNames

Helper function for determining the vector of attribute names of a given object.
getMaxIndexOfRows

Find row- or columnwise the index of the maximal / minimal element in a matrix.
getClass1

Wrapper for class(x)[1].
getMaxIndex

Return index of maximal/minimal element in numerical vector.
getUnixTime

Current time in seconds.
hasAttributes

Check if given object has certain attributes.
getUsedFactorLevels

Determines used factor levels.
getOperatingSystem

Functions to determine the operating system.
getFirst

Get the first/last element of a list/vector.
isExpensiveExampleOk

Conditional checking for expensive examples.
isFALSE

A wrapper for identical(x, FALSE).
isProperlyNamed

Are all elements of a list / vector uniquely named?
is.error

Is return value of try an exception?
insert

Insert elements from one list/vector into another list/vector.
load2

Load RData file and return objects in it.
isEmptyDirectory

Is one / are several directories empty?
isScalarNA

Checks whether an object is a scalar NA value.
isDirectory

Is one / are several files a directory?
normalize

Normalizes numeric data to a given scale.
optimizeSubInts

Naive multi-start version of optimize for global optimization.
dropNamed

Drop named elements of an object.
makeS3Obj

Simple constructor for S3 objects based on lists.
makeProgressBar

Create a progress bar with estimated time.
convertMatrixType

Converts storage type of a matrix.
isSubset

Check subset relation on two vectors.
dapply

Call lapply on an object and return a data.frame.
sortByCol

Sort the rows of a data.frame according to one or more columns.
requirePackages

Require some packages.
toRangeStr

Convert a numerical vector into a range string.
splitPath

Split a path into components
vlapply

Apply a function with a predefined return value
lib

A wrapper for library.
setRowNames

Wrapper for rownames(x) = y, colnames(x) = y.
pause

Pause in interactive mode and continue on .
printStrToChar

Print str(x) of an object to a string / character vector.
names2

Replacement for names which always returns a vector.
setValue

Set a list element to a new value.
%nin%

Simply a negated in operator.
suppressAll

Suppresses all output except for errors.
strrepeat

Repeat and join a string
lsort

A wrapper for sort to sort using the “C” collating rules.
makeFileCache

A caching wrapper around load2.
makeDataFrame

Initialize data.frame in a convenient way.
namedList

Create named list, possibly initialized with a certain element.
setAttribute

A wrapper for attr(x, which) = y.
setClasses

A wrapper for class(x) = classes.
printToChar

Prints object to a string / character vector.
system3

Wrapper for system2 with better return type and errorhandling.
symdiff

Calculates symmetric set difference between two sets.
rangeVal

Calculate range statistic.
splitTime

Split seconds into handy chunks of time.
warningf

Wrapper for warning and sprintf.
stopf

Wrapper for stop and sprintf.
isScalarValue

Is given argument an atomic vector or factor of length 1?
which.first

Find the index of first/last TRUE value in a logical vector.
rowLapply

Apply function to rows of a data frame.
isValidName

Can some strings be used for column or list element names without problems?
isSuperset

Check superset relation on two vectors.
mapValues

Replace values in atomic vectors
makeSimpleFileLogger

Simple logger which outputs to a file.
save2

Save multiple objects to a file.
seq_row

Generate sequences along rows or cols.
messagef

Wrapper for message and sprintf.
itostr

Convert Integers to Strings