Learn R Programming

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

R.utils (version 0.9.8)

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

192,589

Version

0.9.8

License

LGPL version 2.1 or newer (the releases)

Maintainer

Henrik Bengtsson

Last Published

February 24th, 2025

Functions in R.utils (0.9.8)

as.character.GString

Gets the processed character string
as.double.Verbose

Gets a numeric value of this object
Options

The Options class
Sys.setenv

Sys.setenv
asLong.Java

Converts a numeric to a Java long
Arguments

Static class to validate and process arguments
isScalar.Assert

Static method asserting thatan object is a single value
moveInSearchPath

Moves a environment in the search path to another position
as.character.Verbose

Returns a character string version of this object
eps

EPS graphics device
evaluate.Verbose

Evaluates a function and prints its results if above threshold
findGhostscript.System

Searches for the ghostview binary on the current system
getBarString.ProgressBar

Gets the progress bar string to be displayed
Assert

The Assert class
addFinalizerToLast

Modifies .Last() to call 'finalizeSession()
bunzip2

Bunzip a file
getBuiltinRversion.GString

Gets the current R version
ProgressBar

Provides text based counting progress bar
Settings

Class for applicational settings
FileProgressBar

A progress bar that sets the size of a file accordingly
currentTimeMillis.System

Get the current time in milliseconds
Java

Static class for Java related methods
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
as.logical.Verbose

Gets a logical value of this object
callHooks.function

Call hook functions
capture.Verbose

Captures output of a function
TextStatusBar

A status bar at the R prompt that can be updated
NullVerbose

A Verbose class ignoring everything
MultiVerbose

A Verbose class ignoring everything
gunzip

Gunzip a file
isUrl

Checks if one or several pathnames is URLs
getLabel.TextStatusBar

Gets the current value of a label
getRegularExpression.Arguments

Gets a valid regular expression pattern
as.character.Options

Returns a character string version of this object
readByte.Java

Reads a Java formatted byte (8 bits) from a connection
getVariableValue.GString

Gets a variable value given a name and attributes
isDirectory

Checks if the file specification is a directory
isVector.Assert

Static method asserting thatan object is a vector
getOption.Options

Gets an option
SmartComments

Abstract class SmartComments
sourceTo

Parses and evaluates code from a file or a connection
isOn.NullVerbose

Checks if the output is on
arrayIndex

Converts vector indices to array indices
getReadablePathnames.Arguments

Gets a readable pathname
inherits.Assert

Static method asserting that an object inherits from of a certain class
isModified.Settings

Checks if settings has been modified compared to whats on file
VComments

The VComments class
getUsername.System

Retrieves the name of the user running R
as.character.ProgressBar

Gets a string description of the progress bar
isAbsolutePath

Checks if this pathname is absolute
isFile

Checks if the file specification is a file
printf.Verbose

Formats and prints object if above threshold
GString

Character string with advanced substitutions
reset.SmartComments

Resets a SmartComments compiler
newline.Verbose

Writes one or several empty lines
mkdirs

Creates a directory including any necessary but nonexistent parent directories
names.Options

Gets the full pathname of all (non-list) options
asInt.Java

Converts an numeric to a Java integer
isVisible.NullVerbose

Checks if a certain verbose level will be shown or not
displayCode

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

Creates a cloned instance with a higher threshold
loadToEnv

Method to load objects to a new environment
relibrary

Reloads a package
saveAnywhere.Settings

Saves settings to file
parseDebian.System

Parses a string, file or connection for Debian formatted parameters
loadAnywhere.Settings

Loads settings from file
resetWarnings

Resets recorded warnings
as.list.Options

Gets a list representation of the options
asShort.Java

Converts a numeric to a Java short
getVector.Arguments

Validates a vector
convertComment.SmartComments

Converts a single smart comment to R code
png2

A PNG device for Bitmap Files via GhostScript
R.utils-package

Package R.utils
setMaxValue.ProgressBar

Sets maximum value
cat.Verbose

Concatenates and prints objects if above threshold
callHooks

Call hook functions by hook name
remove.FileProgressBar

Removes the progress file for a file progress bar
pushState.Verbose

Pushes the current indentation state of the Verbose object
Non-documented objects

Non-documented objects
isVisible.Verbose

Checks if a certain verbose level will be shown or not
copyDirectory

Copies a directory
setTimestampFormat.Verbose

Sets the default timestamp format
readShort.Java

Reads a Java formatted short (16 bits) from a connection
check.Assert

Static method asserting that a generic condition is true
nbrOfOptions.Options

Gets the number of options set
attachLocally.list

Assigns an objects elements locally
saveObject

Saves an object to a file or a connection
as.character.binmode

Converts a binary/octal/hexadecimal number into a string
capitalize

Capitalizes/decapitalizes each character string in a vector
findSettings.Settings

Searches for the settings file in one or several directories
getWritablePathname.Arguments

Gets a writable pathname
reset.ProgressBar

Reset progress bar
off.Verbose

Turn off the output
getBuiltinDate.GString

Gets the current date
enter.Verbose

Writes a message and indents the following output
getBuiltinHostname.GString

Gets the hostname of the system running R
equals.Options

Checks if this object is equal to another Options object
compile.SmartComments

Preprocess a vector of code lines
equals.Verbose

Checks if this object is equal to another
getHostname.System

Retrieves the computer name of the current host
flush.TextStatusBar

Flushes the output
getLogicals.Arguments

Coerces to a logical vector and validates
System

Static class to query information about the system
setValue.ProgressBar

Sets current value
getBuiltinTime.GString

Gets the current time
listDirectory

Gets the file names in the directory
openBrowser.System

Opens an HTML document using the OS default HTML browser
getThreshold.Verbose

Gets current verbose threshold
getBuiltinRhome.GString

Gets the path where R is installed
hasUrlProtocol

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

Sets verbose threshold
print.Verbose

Prints objects if above threshold
filePath

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

Prints the processed GString
setStepLength.ProgressBar

Sets default step length
getNumerics.Arguments

Coerces to a numeric vector and validates
getBuiltinUsername.GString

Gets the username of the user running R
isOn.Verbose

Checks if the output is on
getParent

Gets the string of the parent specified by this pathname
asByte.Java

Converts a numeric to a Java byte
readInt.Java

Reads a Java formatted int (32 bits) from a connection
increase.ProgressBar

Increases (steps) progress bar
dataFrame

Allocates a data frame with given column classes
jpeg2

A JPEG device for Bitmap Files via GhostScript
getBuiltinOs.GString

Gets the operating system of the running machine
getCharacters.Arguments

Coerces to a character vector and validates
setLabels.TextStatusBar

Sets new values of given labels
isEof.connection

Checks if the current file position for a connection is at the 'End of File'
getIndices.Arguments

Coerces to a integer vector and validates
getRaw.GString

Gets the unprocessed GString
findGraphicsDevice.System

Searches for a working PNG device
intToBin

Converts an integer to a binary/octal/hexadecimal number
getIntegers.Arguments

Coerces to a integer vector and validates
isMatrix.Assert

Static method asserting thatan object is a matrix
readTable

Reads a file in table format
getAbsolutePath

Gets the absolute pathname string
getEnvironment.Arguments

Gets an existing environment
getBuiltinDatetime.GString

Gets the current date and time
setDefaultLevel.Verbose

Sets the current default verbose level
ruler.Verbose

Writes a ruler
lapply.MultiVerbose

Applies a function to each of the Verbose objects
setProgress.ProgressBar

Sets current progress
on.Verbose

Turn on the output
getReadablePathname.Arguments

Gets a readable pathname
setLabel.TextStatusBar

Sets the value of a label
extract.array

Extract a subset of an array, matrix or a vector with unknown dimensions
writeRaw.MultiVerbose

Writes to each of the Verbose objects
writeInt.Java

Writes a integer (32 bits) to a connection in Java format
isDone.ProgressBar

Checks if progress bar is completed
finalizeSession

Function to call for finalizing the R session
isOpen.character

Checks if there is an open connection in Rto a file
getTimestampFormat.Verbose

Gets the default timestamp format
getRelativePath

Gets the relative pathname relative to a directory
onSessionExit

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

Writes a byte (8 bits) to a connection in Java format
detachPackage

Detaches a packages by name
wrap.array

Reshape an array or a matrix by permuting and/or joining dimensions
writeRaw.NullVerbose

All output methods
patchCode

Patches installed and loaded packages and more
insert

Insert values to a vector at certain positions
header.Verbose

Writes a header
writeUTF.Java

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

Creates a cloned instance with a lower threshold
promptAndSave.Settings

Prompt user to save modified settings
loadObject

Method to load object from a file or a connection
copyFile

Copies a file safely
readTableIndex

Reads a single column from file in table format
parse.GString

Parses a GString
reassignInPackage

Re-assigns a new value to an existing object in a loaded package
getBuiltinPid.GString

Gets the process id of the current R session
commandArgs

Extract Command Line Arguments
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
toUrl

Converts a pathname into a URL
summary.Verbose

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

Parses one single smart comment
popMessage.TextStatusBar

Adds a message above the status bar
LComments

The LComments class
warnings.Verbose

Outputs any warnings recorded
convertComment.VComments

Converts a verbose comment to R code
getLeaves.Options

Gets all (non-list) options in a flat list
setTicks.ProgressBar

Sets values for which ticks should be visible
hasOption.Options

Checks if an option exists
getDoubles.Arguments

Coerces to a double vector and validates
exit.Verbose

Writes a message and unindents the following output
isZero

Checks if a value is (close to) zero or not
timestamp.Verbose

Writes a timestamp
unwrap.array

Unwrap an array, matrix or a vector to an array of more dimensions
splitByPattern

Splits a single character string by pattern
lastModified

Gets the time when the file was last modified
newline.TextStatusBar

Writes a newline
reset.VComments

Resets a VComments compiler
writeRaw.Verbose

Writes objects if above threshold
update.ProgressBar

Updates progress bar
update.FileProgressBar

Updates file progress bar
readUTF.Java

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

Sources files recursively to either local or global environment
timestampOn.Verbose

Turns automatic timestamping on and off
validate.SmartComments

Validates the compiled lines
update.TextStatusBar

Updates the status bar (visually)
updateLabels.TextStatusBar

Sets the new values of given labels and updates the status bar
writeShort.Java

Writes a short (16 bits) to a connection in Java format
str.Verbose

Prints the structure of an object if above threshold
toCamelCase

Converts a string of words into a merged camel-cased word
str.Options

Prints the structure of the options
Verbose

Class to writing verbose messages to a connection or file
doCall

Executes a function call with option to ignore unused arguments
getVerbose.Arguments

Coerces to Verbose object
seqToHumanReadable

Gets a short human readable string representation of an vector of indices
setOption.Options

Sets an option
seqToIntervals

Gets all contigous intervals of a vector of indices
validate.VComments

Validates the compiled lines