Learn R Programming

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

R.utils (version 1.9.11)

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

191,979

Version

1.9.11

License

LGPL (>= 2.1)

Last Published

January 23rd, 2012

Functions in R.utils (1.9.11)

Arguments

Static class to validate and process arguments
devNew

Opens a new device
off.Verbose

Turn off the output
devSet

Activates a device
isScalar.Assert

Static method asserting thatan object is a single value
TextStatusBar

A status bar at the R prompt that can be updated
Sys.setenv

Sys.setenv
hpaste

Concatenating vectors into human-readable strings
devEval

Opens a new device, evaluate (graphing) code, and closes device
as.character.binmode

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

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

Returns a character string version of this object
evalCapture

Evaluates an expression and captures the code and/or the output
Options

The Options class
devIsOpen

Checks if a device is open or not
as.character.ProgressBar

Gets a string description of the progress bar
getDoubles.Arguments

Coerces to a double vector and validates
Java

Static class for Java related methods
cat.Verbose

Concatenates and prints objects if above threshold
System

Static class to query information about the system
callHooks

Call hook functions by hook name
VComments

The VComments class
getBuiltinUsername.GString

Gets the username of the user running R
getIndices.Arguments

Coerces to a integer vector and validates
FileProgressBar

A progress bar that sets the size of a file accordingly
displayCode

Displays the contents of a text file with line numbers and more
callHooks.function

Call hook functions
isOn.NullVerbose

Checks if the output is on
eps

EPS graphics device
downloadFile.character

Downloads a file
getVariableValue.GString

Gets a variable value given a name and attributes
asInt.Java

Converts an numeric to a Java integer
isFile

Checks if the file specification is a file
mapToIntervals.numeric

Maps values to intervals
getIntegers.Arguments

Coerces to a integer vector and validates
isModified.Settings

Checks if settings has been modified compared to whats on file
as.logical.Verbose

Gets a logical value of this object
getVector.Arguments

Validates a vector
colClasses

Creates a vector of column classes used for tabular reading
Non-documented objects

Non-documented objects
createFileAtomically

Creates a file atomically
bunzip2

Bunzip a file
GString

Character string with advanced substitutions
getRelativePath

Gets the relative pathname relative to a directory
getParent

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

Coerces to Verbose object
png2

A PNG device for Bitmap Files via GhostScript
findGraphicsDevice.System

Searches for a working PNG device
resample

Sample values from a set of elements
capture.Verbose

Captures output of a function
loadAnywhere.Settings

Loads settings from file
MultiVerbose

A Verbose class ignoring everything
saveAnywhere.Settings

Saves settings to file
resetWarnings

Resets recorded warnings
asShort.Java

Converts a numeric to a Java short
isEof.connection

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

Updates the timestamp of a file
NullVerbose

A Verbose class ignoring everything
getRaw.GString

Gets the unprocessed GString
names.Options

Gets the full pathname of all (non-list) options
flush.TextStatusBar

Flushes the output
less.Verbose

Creates a cloned instance with a higher threshold
as.double.Verbose

Gets a numeric value of this object
getBuiltinOs.GString

Gets the operating system of the running machine
asLong.Java

Converts a numeric to a Java long
fileAccess

Checks the permission of a file or a directory
Settings

Class for applicational settings
readTableIndex

Reads a single column from file in table format
attachLocally.list

Assigns an objects elements locally
readTable

Reads a file in table format
getBarString.ProgressBar

Gets the progress bar string to be displayed
asByte.Java

Converts a numeric to a Java byte
check.Assert

Static method asserting that a generic condition is true
ProgressBar

Provides text based counting progress bar
getBuiltinPid.GString

Gets the process id of the current R session
evalWithTimeout

Evaluate an R expression and interrupts it if it takes too long
addFinalizerToLast

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

Gets the file names in the directory
commandArgs

Extract Command Line Arguments
convertComment.VComments

Converts a verbose comment to R code
capitalize

Capitalizes/decapitalizes each character string in a vector
LComments

The LComments class
devOptions

Gets the default device options
createLink

Creates a link to a file or a directory
TimeoutException

TimeoutException represents timeout errors
getLogicals.Arguments

Coerces to a logical vector and validates
gzip

Gzip/Gunzip a file
SmartComments

Abstract class SmartComments
Assert

The Assert class
copyDirectory

Copies a directory
R.utils-package

Package R.utils
as.character.Options

Returns a character string version of this object
getOption.Options

Gets an option
env

Creates a new environment, evaluates an expression therein, and returns the environment
copyFile

Copies a file safely
findGhostscript.System

Searches for the ghostview binary on the current system
equals.Verbose

Checks if this object is equal to another
getBuiltinTime.GString

Gets the current time
isReplicated

Identifies all entries with replicated values
findSettings.Settings

Searches for the settings file in one or several directories
devOff

Closes a device
detachPackage

Detaches a packages by name
dataFrame

Allocates a data frame with given column classes
currentTimeMillis.System

Get the current time in milliseconds
filePath

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

Gets the path where R is installed
findSourceTraceback

Finds all 'srcfile' objects generated by source() in all call frames
as.character.GString

Gets the processed character string
createWindowsShortcut

Creates a Microsoft Windows Shortcut (.lnk file)
as.list.Options

Gets a list representation of the options
getEnvironment.Arguments

Gets an existing environment
parse.SmartComments

Parses one single smart comment
intToBin

Converts an integer to a binary/octal/hexadecimal number
update.FileProgressBar

Updates file progress bar
readRdHelp

Reads one or more Rd help files in a certain format
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
patchCode

Patches installed and loaded packages and more
isZero

Checks if a value is (close to) zero or not
jpeg2

A JPEG device for Bitmap Files via GhostScript
printf

C-style formatted output
insert

Insert values to a vector at certain positions
intervalsToSeq.matrix

Generates a vector of indices from a matrix of intervals
subplots

Creates a grid of subplots
pushTemporaryFile

Appends a temporary suffix to the pathname
writeRaw.Verbose

Writes objects if above threshold
dimNA< -

Sets the dimension of an object with the option to infer one dimension autmatically
devList

Lists the indices of the open devices named by their labels
getReadablePathnames.Arguments

Gets a readable pathname
stext

Writes text in the margin along the sides of a plot
relibrary

Reloads a package
isVisible.NullVerbose

Checks if a certain verbose level will be shown or not
setStepLength.ProgressBar

Sets default step length
isMatrix.Assert

Static method asserting thatan object is a matrix
setLabel.TextStatusBar

Sets the value of a label
setValue.ProgressBar

Sets current value
readByte.Java

Reads a Java formatted byte (8 bits) from a connection
popMessage.TextStatusBar

Adds a message above the status bar
ruler.Verbose

Writes a ruler
renameFile

Renames a file safely
on.Verbose

Turn on the output
timestampOn.Verbose

Turns automatic timestamping on and off
getBuiltinHostname.GString

Gets the hostname of the system running R
toEPS

Methods for creating image files of a specific format
update.ProgressBar

Updates progress bar
isVector.Assert

Static method asserting thatan object is a vector
increase.ProgressBar

Increases (steps) progress bar
writeShort.Java

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

Pushes the current indentation state of the Verbose object
setTimestampFormat.Verbose

Sets the default timestamp format
toUrl

Converts a pathname into a URL
promptAndSave.Settings

Prompt user to save modified settings
devGetLabel

Gets the label of a device
getInstanceOf.Arguments

Gets an instance of the object that is of a particular class
seqToHumanReadable

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

Formats and prints object if above threshold
enter.Verbose

Writes a message and indents the following output
writeInt.Java

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

Sets values for which ticks should be visible
getThreshold.Verbose

Gets current verbose threshold
setLabels.TextStatusBar

Sets new values of given labels
hasOption.Options

Checks if an option exists
convertComment.SmartComments

Converts a single smart comment to R code
getLeaves.Options

Gets all (non-list) options in a flat list
openBrowser.System

Opens an HTML document using the OS default HTML browser
equals.Options

Checks if this object is equal to another Options object
isOpen.character

Checks if there is an open connection to a file
isPackageLoaded

Checks if a package is loaded or not
loadObject

Method to load object from a file or a connection
remove.FileProgressBar

Removes the progress file for a file progress bar
getBuiltinDatetime.GString

Gets the current date and time
isDirectory

Checks if the file specification is a directory
setMaxValue.ProgressBar

Sets maximum value
onSessionExit

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

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

Reads a Microsoft Windows Shortcut (.lnk file)
mkdirs

Creates a directory including any necessary but nonexistent parent directories
setThreshold.Verbose

Sets verbose threshold
readBinFragments

Reads binary data from disjoint sections of a connection or a file
arrayIndex

Converts vector indices to array indices
isDone.ProgressBar

Checks if progress bar is completed
validate.SmartComments

Validates the compiled lines
reset.VComments

Resets a VComments compiler
isSingle

Identifies all entries that exists exactly ones
loadToEnv

Method to load objects to a new environment
exit.Verbose

Writes a message and unindents the following output
isPackageInstalled

Checks if a package is installed or not
splitByPattern

Splits a single character string by pattern
print.Verbose

Prints objects if above threshold
popTemporaryFile

Drops a temporary suffix from the temporary pathname
str.Options

Prints the structure of the options
writeRaw.NullVerbose

All output methods
getBuiltinRversion.GString

Gets the current R version
getHostname.System

Retrieves the computer name of the current host
whichVector.logical

Identifies TRUE elements in a logical vector
saveObject

Saves an object to a file or a connection
warnings.Verbose

Outputs any warnings recorded
readShort.Java

Reads a Java formatted short (16 bits) from a connection
isAbsolutePath

Checks if this pathname is absolute
print.GString

Prints the processed GString
getWritablePathname.Arguments

Gets a writable pathname
getMessage.TimeoutException

Gets the message of the exception
summary.Verbose

Generates a summary of an object if above threshold
wrap.array

Reshape an array or a matrix by permuting and/or joining dimensions
getRegularExpression.Arguments

Gets a valid regular expression pattern
evaluate.Verbose

Evaluates a function and prints its results if above threshold
extract.array

Extract a subset of an array, matrix or a vector with unknown dimensions
getBuiltinDate.GString

Gets the current date
parse.GString

Parses a GString
getUsername.System

Retrieves the name of the user running R
popBackupFile

Drops a backup suffix from the backup pathname
seqToIntervals

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

Writes one or several empty lines
pushBackupFile

Appends a backup suffix to the pathname
sourceTo

Parses and evaluates code from a file or a connection
devSetLabel

Sets the label of a device
header.Verbose

Writes a header
writeBinFragments

Writes binary data to disjoint sections of a connection or a file
getTimestampFormat.Verbose

Gets the default timestamp format
newline.TextStatusBar

Writes a newline
writeDataFrame.data.frame

Writes a data.frame to tabular text file
updateLabels.TextStatusBar

Sets the new values of given labels and updates the status bar
getReadablePathname.Arguments

Gets a readable pathname
toCamelCase

Converts a string of words into a merged camel-cased word
inAnyInterval.numeric

Checks if a set of values are inside one or more intervals
validate.VComments

Validates the compiled lines
nbrOfOptions.Options

Gets the number of options set
readInt.Java

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

Checks if the output is on
getAbsolutePath

Gets the absolute pathname string
queryRCmdCheck

Gets the on R CMD check if the current R session was launched by it
isUrl

Checks if one or several pathnames is URLs
moveInSearchPath

Moves a environment in the search path to another position
lastModified

Gets the time when the file was last modified
setDefaultLevel.Verbose

Sets the current default verbose level
lapply.MultiVerbose

Applies a function to each of the Verbose objects
onGarbageCollect

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

Parses a string, file or connection for Debian formatted parameters
setOption

Sets a option in R
getNumerics.Arguments

Coerces to a numeric vector and validates
reset.SmartComments

Resets a SmartComments compiler
str.Verbose

Prints the structure of an object if above threshold
update.TextStatusBar

Updates the status bar (visually)
isVisible.Verbose

Checks if a certain verbose level will be shown or not
reset.ProgressBar

Reset progress bar
writeByte.Java

Writes a byte (8 bits) to a connection in Java format
setOption.Options

Sets an option
sourceDirectory

Sources files recursively to either local or global environment
finalizeSession

Function to call for finalizing the R session
getCharacters.Arguments

Coerces to a character vector and validates
mergeIntervals.numeric

Merges intervals
getLabel.TextStatusBar

Gets the current value of a label
setProgress.ProgressBar

Sets current progress
Verbose

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

Writes to each of the Verbose objects
countLines

Counts the number of lines in a text file
compile.SmartComments

Preprocess a vector of code lines
reassignInPackage

Re-assigns a new value to an existing object in a loaded package
timestamp.Verbose

Writes a timestamp
removeDirectory

Removes a directory
devDone

Closes an open device unless it is a on-screen (interactive) device
inherits.Assert

Static method asserting that an object inherits from of a certain class
more.Verbose

Creates a cloned instance with a lower threshold
writeUTF.Java

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

Unwrap an array, matrix or a vector to an array of more dimensions
getLoadedPathname.Settings

Gets the pathname of the settings file loaded