Learn R Programming

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

BBmisc (version 1.9)

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

16,209

Version

1.9

License

BSD_3_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bernd Bischl

Last Published

February 3rd, 2015

Functions in BBmisc (1.9)

cFactor

Combine multiple factors and return a factor.
convertMatrixType

Converts storage type of a matrix.
getOperatingSystem

Functions to determine the operating system.
convertListOfRowsToDataFrame

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

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

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

A wrapper to add to the class attribute.
coalesce

Returns first non-missing, non-null argument.
asMatrixCols

Extracts a named element from a list of lists.
getClass1

Wrapper for class(x)[1].
getFirst

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

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

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

Repeat and join a string
makeS3Obj

Simple constructor for S3 objects based on lists.
printStrToChar

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

Is return value of try an exception?
makeDataFrame

Initialize data.frame in a convenient way.
isSubset

Check subset relation on two vectors.
collapse

Collapse vector to string.
sortByCol

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

Suppresses all output except for errors.
optimizeSubInts

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

Generate sequences along rows or cols.
getMaxIndexOfRows

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

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

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

Collapse vector to string.
isDirectory

Is one / are several files a directory?
computeMode

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

Split up a string into substrings.
mapValues

Replace values in atomic vectors
checkListElementClass

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

Conversion for integer vector.
getUnixTime

Current time in seconds.
isFALSE

A wrapper for identical(x, FALSE).
getRelativePath

Construct a path relative to another
stopf

Wrapper for stop and sprintf.
setClasses

A wrapper for class(x) = classes.
splitTime

Split seconds into handy chunks of time.
isScalarValue

Is given argument an atomic vector or factor of length 1?
getUsedFactorLevels

Determines used factor levels.
isScalarNA

Checks whether an object is a scalar NA value.
convertInteger

Conversion for single integer.
asQuoted

Converts a string into a quoted expression.
makeSimpleFileLogger

Simple logger which outputs to a file.
makeProgressBar

Create a progress bar with estimated time.
chunk

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

Drop named elements of an object.
clipString

Shortens strings to a given length.
getAttributeNames

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

Check if given object has certain attributes.
isProperlyNamed

Are all elements of a list / vector uniquely named?
lib

A wrapper for library.
isExpensiveExampleOk

Conditional checking for expensive examples.
deprecated

Deprecated function. Do not use!
rowLapply

Apply function to rows of a data frame.
normalize

Normalizes numeric data to a given scale.
warningf

Wrapper for warning and sprintf.
%nin%

Simply a negated in operator.
symdiff

Calculates symmetric set difference between two sets.
vlapply

Apply a function with a predefined return value
requirePackages

Require some packages.
which.first

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

Simple bin packing.
filterNull

Filter a list for NULL values
setValue

Set a list element to a new value.
lsort

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

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

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

A caching wrapper around load2.
itostr

Convert Integers to Strings
pause

Pause in interactive mode and continue on .
checkArg

Check for a function argument.
messagef

Wrapper for message and sprintf.
rangeVal

Calculate range statistic.
argsAsNamedList

Parses ... arguments to a named list.
dapply

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

Wrapper for cat and sprintf.
splitPath

Split a path into components
extractSubList

Extracts a named element from a list of lists.
toRangeStr

Convert a numerical vector into a range string.
isEmptyDirectory

Is one / are several directories empty?
isValidName

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

Load RData file and return objects in it.
names2

Replacement for names which always returns a vector.
isSuperset

Check superset relation on two vectors.
system3

Wrapper for system2 with better return type and errorhandling.
do.call2

Execute a function call similar to do.call.
save2

Save multiple objects to a file.
%btwn%

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

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

Prints object to a string / character vector.