Learn R Programming

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

R.utils (version 1.4.4)

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

258,151

Version

1.4.4

License

LGPL (>= 2.1)

Maintainer

Henrik Bengtsson

Last Published

July 26th, 2010

Functions in R.utils (1.4.4)

as.character.GString

Gets the processed character string
evaluate.Verbose

Evaluates a function and prints its results if above threshold
R.utils-package

Package R.utils
TextStatusBar

A status bar at the R prompt that can be updated
asByte.Java

Converts a numeric to a Java byte
devGetLabel

Gets the label of a device
as.character.binmode

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

Character string with advanced substitutions
as.character.ProgressBar

Gets a string description of the progress bar
Verbose

Class to writing verbose messages to a connection or file
NullVerbose

A Verbose class ignoring everything
LComments

The LComments class
MultiVerbose

A Verbose class ignoring everything
getBuiltinOs.GString

Gets the operating system of the running machine
devDone

Closes an on-screen (interactive) device
devIsOpen

Checks if a device is open or not
findSourceTraceback

Finds all 'srcfile' objects generated by source() in all call frames
getUsername.System

Retrieves the name of the user running R
cat.Verbose

Concatenates and prints objects if above threshold
as.logical.Verbose

Gets a logical value of this object
isPackageInstalled

Checks if a package is installed or not
addFinalizerToLast

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

Static class to query information about the system
isDirectory

Checks if the file specification is a directory
copyFile

Copies a file safely
check.Assert

Static method asserting that a generic condition is true
arrayIndex

Converts vector indices to array indices
getBuiltinPid.GString

Gets the process id of the current R session
getBuiltinDatetime.GString

Gets the current date and time
getBuiltinDate.GString

Gets the current date
getInstanceOf.Arguments

Gets an instance of the object that is of a particular class
increase.ProgressBar

Increases (steps) progress bar
SmartComments

Abstract class SmartComments
dimNA< -

Sets the dimension of an object with the option to infer one dimension autmatically
attachLocally.list

Assigns an objects elements locally
getNumerics.Arguments

Coerces to a numeric vector and validates
compile.SmartComments

Preprocess a vector of code lines
capture.Verbose

Captures output of a function
as.character.Verbose

Returns a character string version of this object
getHostname.System

Retrieves the computer name of the current host
getCharacters.Arguments

Coerces to a character vector and validates
getBuiltinUsername.GString

Gets the username of the user running R
getLeaves.Options

Gets all (non-list) options in a flat list
popMessage.TextStatusBar

Adds a message above the status bar
commandArgs

Extract Command Line Arguments
currentTimeMillis.System

Get the current time in milliseconds
inAnyInterval.numeric

Checks if a set of values are inside one or more intervals
asInt.Java

Converts an numeric to a Java integer
findSettings.Settings

Searches for the settings file in one or several directories
bunzip2

Bunzip a file
createWindowsShortcut

Creates a Microsoft Windows Shortcut (.lnk file)
sourceDirectory

Sources files recursively to either local or global environment
findGhostscript.System

Searches for the ghostview binary on the current system
hasOption.Options

Checks if an option exists
convertComment.VComments

Converts a verbose comment to R code
lapply.MultiVerbose

Applies a function to each of the Verbose objects
isEof.connection

Checks if the current file position for a connection is at the 'End of File'
capitalize

Capitalizes/decapitalizes each character string in a vector
isOn.Verbose

Checks if the output is on
asLong.Java

Converts a numeric to a Java long
getEnvironment.Arguments

Gets an existing environment
isZero

Checks if a value is (close to) zero or not
flush.TextStatusBar

Flushes the output
callHooks

Call hook functions by hook name
parseDebian.System

Parses a string, file or connection for Debian formatted parameters
getOption.Options

Gets an option
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
less.Verbose

Creates a cloned instance with a higher threshold
downloadFile.character

Downloads a file
devSetLabel

Sets the label of a device
equals.Verbose

Checks if this object is equal to another
printf

C-style formatted output
as.double.Verbose

Gets a numeric value of this object
isVisible.Verbose

Checks if a certain verbose level will be shown or not
getBuiltinHostname.GString

Gets the hostname of the system running R
copyDirectory

Copies a directory
getThreshold.Verbose

Gets current verbose threshold
Non-documented objects

Non-documented objects
finalizeSession

Function to call for finalizing the R session
inherits.Assert

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

Class for applicational settings
devList

Lists the indices of the open devices named by their labels
filePath

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

Converts a numeric to a Java short
isFile

Checks if the file specification is a file
callHooks.function

Call hook functions
Assert

The Assert class
VComments

The VComments class
getLogicals.Arguments

Coerces to a logical vector and validates
mapToIntervals.numeric

Maps values to intervals
readTable

Reads a file in table format
setThreshold.Verbose

Sets verbose threshold
promptAndSave.Settings

Prompt user to save modified settings
dataFrame

Allocates a data frame with given column classes
convertComment.SmartComments

Converts a single smart comment to R code
as.character.Options

Returns a character string version of this object
devOff

Closes a device
isAbsolutePath

Checks if this pathname is absolute
exit.Verbose

Writes a message and unindents the following output
getReadablePathname.Arguments

Gets a readable pathname
getParent

Gets the string of the parent specified by this pathname
saveObject

Saves an object to a file or a connection
devSet

Activates a device
intervalsToSeq.matrix

Generates a vector of indices from a matrix of intervals
getBuiltinRversion.GString

Gets the current R version
fileAccess

Checks the permission of a file or a directory
findGraphicsDevice.System

Searches for a working PNG device
reassignInPackage

Re-assigns a new value to an existing object in a loaded package
isOn.NullVerbose

Checks if the output is on
ruler.Verbose

Writes a ruler
jpeg2

A JPEG device for Bitmap Files via GhostScript
setDefaultLevel.Verbose

Sets the current default verbose level
mergeIntervals.numeric

Merges intervals
getRelativePath

Gets the relative pathname relative to a directory
seqToIntervals

Gets all contigous intervals of a vector of indices
on.Verbose

Turn on the output
getBuiltinTime.GString

Gets the current time
update.TextStatusBar

Updates the status bar (visually)
subplots

Creates a grid of subplots
gzip

Gzip/Gunzip a file
colClasses

Creates a vector of column classes used for tabular reading
equals.Options

Checks if this object is equal to another Options object
readByte.Java

Reads a Java formatted byte (8 bits) from a connection
timestampOn.Verbose

Turns automatic timestamping on and off
isVisible.NullVerbose

Checks if a certain verbose level will be shown or not
summary.Verbose

Generates a summary of an object if above threshold
writeUTF.Java

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

Writes binary data to disjoint sections of a connection or a file
insert

Insert values to a vector at certain positions
timestamp.Verbose

Writes a timestamp
writeRaw.Verbose

Writes objects if above threshold
displayCode

Displays the contents of a text file with line numbers and more
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
ProgressBar

Provides text based counting progress bar
setLabels.TextStatusBar

Sets new values of given labels
doCall

Executes a function call with option to ignore unused arguments
readUTF.Java

Reads a Java (UTF-8) formatted string from a connection
setTimestampFormat.Verbose

Sets the default timestamp format
getBarString.ProgressBar

Gets the progress bar string to be displayed
warnings.Verbose

Outputs any warnings recorded
getRegularExpression.Arguments

Gets a valid regular expression pattern
remove.FileProgressBar

Removes the progress file for a file progress bar
isDone.ProgressBar

Checks if progress bar is completed
isOpen.character

Checks if there is an open connection to a file
parse.SmartComments

Parses one single smart comment
getReadablePathnames.Arguments

Gets a readable pathname
mkdirs

Creates a directory including any necessary but nonexistent parent directories
getRaw.GString

Gets the unprocessed GString
validate.SmartComments

Validates the compiled lines
loadToEnv

Method to load objects to a new environment
listDirectory

Gets the file names in the directory
writeRaw.NullVerbose

All output methods
lastModified

Gets the time when the file was last modified
reset.ProgressBar

Reset progress bar
isPackageLoaded

Checks if a package is loaded or not
print.Verbose

Prints objects if above threshold
getTimestampFormat.Verbose

Gets the default timestamp format
getVerbose.Arguments

Coerces to Verbose object
names.Options

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

Parses and evaluates code from a file or a connection
isMatrix.Assert

Static method asserting thatan object is a matrix
getDoubles.Arguments

Coerces to a double vector and validates
isUrl

Checks if one or several pathnames is URLs
reset.VComments

Resets a VComments compiler
openBrowser.System

Opens an HTML document using the OS default HTML browser
isScalar.Assert

Static method asserting thatan object is a single value
loadObject

Method to load object from a file or a connection
createLink

Creates a link to a file or a directory
touchFile

Updates the timestamp of a file
newline.Verbose

Writes one or several empty lines
nbrOfOptions.Options

Gets the number of options set
wrap.array

Reshape an array or a matrix by permuting and/or joining dimensions
isVector.Assert

Static method asserting thatan object is a vector
newline.TextStatusBar

Writes a newline
str.Options

Prints the structure of the options
patchCode

Patches installed and loaded packages and more
readInt.Java

Reads a Java formatted int (32 bits) from a connection
str.Verbose

Prints the structure of an object if above threshold
moveInSearchPath

Moves a environment in the search path to another position
detachPackage

Detaches a packages by name
Java

Static class for Java related methods
devNew

Opens a new device
getVariableValue.GString

Gets a variable value given a name and attributes
header.Verbose

Writes a header
onGarbageCollect

Registers a function to be called when the R garbage collector is (detected to be) running
setLabel.TextStatusBar

Sets the value of a label
toCamelCase

Converts a string of words into a merged camel-cased word
loadAnywhere.Settings

Loads settings from file
setOption.Options

Sets an option
print.GString

Prints the processed GString
setValue.ProgressBar

Sets current value
off.Verbose

Turn off the output
readBinFragments

Reads binary data from disjoint sections of a connection or a file
update.FileProgressBar

Updates file progress bar
onSessionExit

Registers a function to be called when the R session finishes
setStepLength.ProgressBar

Sets default step length
more.Verbose

Creates a cloned instance with a lower threshold
removeDirectory

Removes a directory
whichVector.logical

Identifies TRUE elements in a logical vector
printf.Verbose

Formats and prints object if above threshold
unwrap.array

Unwrap an array, matrix or a vector to an array of more dimensions
reset.SmartComments

Resets a SmartComments compiler
setMaxValue.ProgressBar

Sets maximum value
writeShort.Java

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

Reloads a package
toUrl

Converts a pathname into a URL
enter.Verbose

Writes a message and indents the following output
updateLabels.TextStatusBar

Sets the new values of given labels and updates the status bar
saveAnywhere.Settings

Saves settings to file
validate.VComments

Validates the compiled lines
FileProgressBar

A progress bar that sets the size of a file accordingly
getIntegers.Arguments

Coerces to a integer vector and validates
getVector.Arguments

Validates a vector
isModified.Settings

Checks if settings has been modified compared to whats on file
setProgress.ProgressBar

Sets current progress
splitByPattern

Splits a single character string by pattern
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
readTableIndex

Reads a single column from file in table format
seqToHumanReadable

Gets a short human readable string representation of an vector of indices
eps

EPS graphics device
extract.array

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

Gets the absolute pathname string
getBuiltinRhome.GString

Gets the path where R is installed
intToBin

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

Gets a writable pathname
parse.GString

Parses a GString
pushState.Verbose

Pushes the current indentation state of the Verbose object
readShort.Java

Reads a Java formatted short (16 bits) from a connection
setTicks.ProgressBar

Sets values for which ticks should be visible
png2

A PNG device for Bitmap Files via GhostScript
writeByte.Java

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

Static class to validate and process arguments
Options

The Options class
as.list.Options

Gets a list representation of the options
countLines

Counts the number of lines in a text file
getLabel.TextStatusBar

Gets the current value of a label
getIndices.Arguments

Coerces to a integer vector and validates
writeInt.Java

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

Updates progress bar
writeRaw.MultiVerbose

Writes to each of the Verbose objects
resetWarnings

Resets recorded warnings