Learn R Programming

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

R.utils (version 0.8.9)

Various programming utilities

Description

This package provides utility classes and methods useful when programming in R and developing R packages.

Copy Link

Version

Install

install.packages('R.utils')

Monthly Downloads

226,490

Version

0.8.9

License

LGPL version 2.1 or newer (the releases)

Maintainer

Henrik Bengtsson

Last Published

February 24th, 2025

Functions in R.utils (0.8.9)

Java

Static class for Java related methods
ProgressBar

Provides text based counting progress bar
arrayIndex

Converts vector indices to array indices
getHostname.System

Retrieves the computer name of the current host
NullVerbose

A Verbose class ignoring everything
capitalize

Capitalizes/decapitalizes each character string in a vector
check.Assert

Static method asserting that a generic condition is true
TextStatusBar

A status bar at the R prompt that can be updated
cat.Verbose

Concatenates and prints objects if above threshold
getBuiltinRversion.GString

Gets the current R version
callHooks.function

Call hook functions
eps

EPS graphics device
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
more.Verbose

Creates a cloned instance with a lower threshold
convertComment.VComments

Converts a verbose comment to R code
filePath

Construct the path to a file from components and expands Windows Shortcuts along the pathname from root to leaf
loadToEnv

Method to load objects to a new environment
currentTimeMillis.System

Get the current time in milliseconds
getOption.Options

Gets an option
getVector.Arguments

Validates a vector
getBuiltinRhome.GString

Gets the path where R is installed
getLeaves.Options

Gets all (non-list) options in a flat list
header.Verbose

Writes a header
as.character.Options

Returns a character string version of this object
SmartComments

Abstract class SmartComments
enter.Verbose

Writes a message and indents the following output
nbrOfOptions.Options

Gets the number of options set
getEnvironment.Arguments

Gets an existing environment
getLabel.TextStatusBar

Gets the current value of a label
LComments

The LComments class
getIndices.Arguments

Coerces to a integer vector and validates
as.character.ProgressBar

Gets a string description of the progress bar
asLong.Java

Converts a numeric to a Java long
displayCode

Displays the contents of a text file with line numbers and more
getThreshold.Verbose

Gets current verbose threshold
isModified.Settings

Checks if settings has been modified compared to whats on file
getCharacters.Arguments

Coerces to a character vector and validates
isDone.ProgressBar

Checks if progress bar is completed
getUsername.System

Retrieves the name of the user running R
getReadablePathnames.Arguments

Gets a readable pathname
on.Verbose

Turn on the output
getRegularExpression.Arguments

Gets a valid regular expression pattern
System

Static class to query information about the system
as.character.Verbose

Returns a character string version of this object
timestampOn.Verbose

Turns automatic timestamping on and off
Assert

The Assert class
capture.Verbose

Captures output of a function
readByte.Java

Reads a Java formatted byte (8 bits) from a connection
listDirectory

Gets the file names in the directory
reset.ProgressBar

Reset progress bar
setTicks.ProgressBar

Sets values for which ticks should be visible
isOn.Verbose

Checks if the output is on
ruler.Verbose

Writes a ruler
getIntegers.Arguments

Coerces to a integer vector and validates
getRaw.GString

Gets the unprocessed GString
str.Verbose

Prints the structure of an object if above threshold
as.list.Options

Gets a list representation of the options
relibrary

Reloads a package
detachPackage

Detaches a packages by name
setMaxValue.ProgressBar

Sets maximum value
readShort.Java

Reads a Java formatted short (16 bits) from a connection
Non-documented objects

Non-documented objects
isAbsolutePath

Checks if this pathname is absolute
update.TextStatusBar

Updates the status bar (visually)
splitByPattern

Splits a single character string by pattern
setThreshold.Verbose

Sets verbose threshold
as.logical.Verbose

Gets a logical value of this object
attachLocally.list

Assigns an objects elements locally
summary.Verbose

Generates a summary of an object if above threshold
compile.SmartComments

Preprocess a vector of code lines
equals.Verbose

Checks if this object is equal to another
isVisible.Verbose

Checks if a certain verbose level will be shown or not
R.utils-package

Package R.utils
equals.Options

Checks if this object is equal to another Options object
addFinalizerToLast

Modifies .Last() to call 'finalizeSession()
popMessage.TextStatusBar

Adds a message above the status bar
getVerbose.Arguments

Coerces to Verbose object
readUTF.Java

Reads a Java (UTF-8) formatted string from a connection
VComments

The VComments class
setLabels.TextStatusBar

Sets new values of given labels
parse.SmartComments

Parses one single smart comment
setOption.Options

Sets an option
getAbsolutePath

Gets the absolute pathname string
toUrl

Converts a pathname into a URL
jpeg2

A JPEG device for Bitmap Files via GhostScript
writeInt.Java

Writes a integer (32 bits) to a connection in Java format
str.Options

Prints the structure of the options
as.character.binmode

Converts a binary/octal/hexadecimal number into a string
asShort.Java

Converts a numeric to a Java short
setProgress.ProgressBar

Sets current progress
as.character.GString

Gets the processed character string
callHooks

Call hook functions by hook name
asInt.Java

Converts an numeric to a Java integer
sourceDirectory

Sources files recursively to either local or global environment
Options

The Options class
Verbose

Class to writing verbose messages to a connection or file
writeRaw.NullVerbose

All output methods
off.Verbose

Turn off the output
FileProgressBar

A progress bar that sets the size of a file accordingly
convertComment.SmartComments

Converts a single smart comment to R code
getBuiltinDate.GString

Gets the current date
copyDirectory

Copies a directory
getBuiltinUsername.GString

Gets the username of the user running R
pushState.Verbose

Pushes the current indentation state of the Verbose object
getBuiltinTime.GString

Gets the current time
getDoubles.Arguments

Coerces to a double vector and validates
getLogicals.Arguments

Coerces to a logical vector and validates
getBuiltinOs.GString

Gets the operating system of the running machine
Settings

Class for applicational settings
getNumerics.Arguments

Coerces to a numeric vector and validates
asByte.Java

Converts a numeric to a Java byte
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
warnings.Verbose

Outputs any warnings recorded
increase.ProgressBar

Increases (steps) progress bar
isVisible.NullVerbose

Checks if a certain verbose level will be shown or not
getWritablePathname.Arguments

Gets a writable pathname
print.GString

Prints the processed GString
isMatrix.Assert

Static method asserting thatan object is a matrix
print.Verbose

Prints objects if above threshold
reset.SmartComments

Resets a SmartComments compiler
isScalar.Assert

Static method asserting thatan object is a single value
hasOption.Options

Checks if an option exists
findGraphicsDevice.System

Searches for a working PNG device
getBuiltinDatetime.GString

Gets the current date and time
inherits.Assert

Static method asserting that an object inherits from of a certain class
getBuiltinHostname.GString

Gets the hostname of the system running R
getBarString.ProgressBar

Gets the progress bar string to be displayed
getRelativePath

Gets the relative pathname relative to a directory
gunzip

Gunzip a file
insert

Insert values to a vector at certain positions
getVariableValue.GString

Gets a variable value given a name and attributes
isUrl

Checks if one or several pathnames is URLs
remove.FileProgressBar

Removes the progress file for a file progress bar
isOn.NullVerbose

Checks if the output is on
findSettings.Settings

Searches for the settings file in one or several directories
wrap.array

Reshape an array or a matrix by permuting and/or joining dimensions
seqToIntervals

Gets all contigous intervals of a vector of indices
patchCode

Patches installed and loaded packages and more
toCamelCase

Converts a string of words into a merged camel-cased word
lastModified

Gets the time when the file was last modified
writeByte.Java

Writes a byte (8 bits) to a connection in Java format
timestamp.Verbose

Writes a timestamp
getBuiltinPid.GString

Gets the process id of the current R session
update.FileProgressBar

Updates file progress bar
loadObject

Method to load object from a file or a connection
saveObject

Saves an object to a file or a connection
mkdirs

Creates a directory including any necessary but nonexistent parent directories
isOpen.character

Checks if there is an open connection in Rto a file
resetWarnings

Resets recorded warnings
onSessionExit

Registers a function to be called when the R session finishes
readInt.Java

Reads a Java formatted int (32 bits) from a connection
names.Options

Gets the full pathname of all (non-list) options
png2

A PNG device for Bitmap Files via GhostScript
less.Verbose

Creates a cloned instance with a higher threshold
isFile

Checks if the file specification is a file
unwrap.array

Unwrap an array, matrix or a vector to an array of more dimensions
parse.GString

Parses a GString
updateLabels.TextStatusBar

Sets the new values of given labels and updates the status bar
seqToHumanReadable

Gets a short human readable string representation of an vector of indices
setDefaultLevel.Verbose

Sets the current default verbose level
getTimestampFormat.Verbose

Gets the default timestamp format
isDirectory

Checks if the file specification is a directory
finalizeSession

Function to call for finalizing the R session
printf.Verbose

Formats and prints object if above threshold
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
writeRaw.Verbose

Writes objects if above threshold
setLabel.TextStatusBar

Sets the value of a label
writeUTF.Java

Writes a string to a connection in Java format (UTF-8)
writeShort.Java

Writes a short (16 bits) to a connection in Java format
moveInSearchPath

Moves a environment in the search path to another position
sourceTo

Parses and evaluates code from a file or a connection
saveAnywhere.Settings

Saves settings to file
setTimestampFormat.Verbose

Sets the default timestamp format
extract.array

Extract a subset of an array, matrix or a vector with unknown dimensions
Arguments

Static class to validate and process arguments
Sys.setenv

Sys.setenv
GString

Character string with advanced substitutions
commandArgs

Extract Command Line Arguments
getParent

Gets the string of the parent specified by this pathname
getReadablePathname.Arguments

Gets a readable pathname
intToBin

Converts an integer to a binary/octal/hexadecimal number
isVector.Assert

Static method asserting thatan object is a vector
findGhostscript.System

Searches for the ghostview binary on the current system
readTable

Reads a file in table format
setStepLength.ProgressBar

Sets default step length
readTableIndex

Reads a single column from file in table format
update.ProgressBar

Updates progress bar
doCall

Executes a function call with option to ignore unused arguments
as.double.Verbose

Gets a numeric value of this object
exit.Verbose

Writes a message and unindents the following output
parseDebian.System

Parses a string, file or connection for Debian formatted parameters
newline.TextStatusBar

Writes a newline
evaluate.Verbose

Evaluates a function and prints its results if above threshold
isZero

Checks if a value is (close to) zero or not
promptAndSave.Settings

Prompt user to save modified settings
validate.VComments

Validates the compiled lines
newline.Verbose

Writes one or several empty lines
openBrowser.System

Opens an HTML document using the OS default HTML browser
validate.SmartComments

Validates the compiled lines
reset.VComments

Resets a VComments compiler
setValue.ProgressBar

Sets current value
loadAnywhere.Settings

Loads settings from file