Learn R Programming

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

R.utils (version 1.9.7)

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.7

License

LGPL (>= 2.1)

Last Published

December 22nd, 2011

Functions in R.utils (1.9.7)

LComments

The LComments class
System

Static class to query information about the system
devGetLabel

Gets the label of a device
getBuiltinTime.GString

Gets the current time
Sys.setenv

Sys.setenv
devList

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

Converts vector indices to array indices
devEval

Opens a new device, evaluate (graphing) code, and closes device
check.Assert

Static method asserting that a generic condition is true
getReadablePathname.Arguments

Gets a readable pathname
Non-documented objects

Non-documented objects
getWritablePathname.Arguments

Gets a writable pathname
inherits.Assert

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

Closes a device
cat.Verbose

Concatenates and prints objects if above threshold
getReadablePathnames.Arguments

Gets a readable pathname
devDone

Closes an open device unless it is a on-screen (interactive) device
Verbose

Class to writing verbose messages to a connection or file
GString

Character string with advanced substitutions
readUTF.Java

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

Returns a character string version of this object
hpaste

Concatenating vectors into human-readable strings
equals.Options

Checks if this object is equal to another Options object
as.list.Options

Gets a list representation of the options
evalWithTimeout

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

Resets recorded warnings
getRegularExpression.Arguments

Gets a valid regular expression pattern
convertComment.SmartComments

Converts a single smart comment to R code
header.Verbose

Writes a header
isVisible.NullVerbose

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

Provides text based counting progress bar
convertComment.VComments

Converts a verbose comment to R code
increase.ProgressBar

Increases (steps) progress bar
countLines

Counts the number of lines in a text file
extract.array

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

Gets the operating system of the running machine
getBarString.ProgressBar

Gets the progress bar string to be displayed
isReplicated

Identifies all entries with replicated values
gzip

Gzip/Gunzip a file
fileAccess

Checks the permission of a file or a directory
env

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

The Assert class
setDefaultLevel.Verbose

Sets the current default verbose level
asInt.Java

Converts an numeric to a Java integer
isOn.NullVerbose

Checks if the output is on
as.character.ProgressBar

Gets a string description of the progress bar
asByte.Java

Converts a numeric to a Java byte
as.character.Options

Returns a character string version of this object
isScalar.Assert

Static method asserting thatan object is a single value
isEof.connection

Checks if the current file position for a connection is at the 'End of File'
R.utils-package

Package R.utils
SmartComments

Abstract class SmartComments
createWindowsShortcut

Creates a Microsoft Windows Shortcut (.lnk file)
findGhostscript.System

Searches for the ghostview binary on the current system
getBuiltinDatetime.GString

Gets the current date and time
getUsername.System

Retrieves the name of the user running R
FileProgressBar

A progress bar that sets the size of a file accordingly
getBuiltinHostname.GString

Gets the hostname of the system running R
as.double.Verbose

Gets a numeric value of this object
bunzip2

Bunzip a file
Settings

Class for applicational settings
devOptions

Gets the default device options
createLink

Creates a link to a file or a directory
png2

A PNG device for Bitmap Files via GhostScript
sourceTo

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

Gets the pathname of the settings file loaded
callHooks.function

Call hook functions
isVector.Assert

Static method asserting thatan object is a vector
setTicks.ProgressBar

Sets values for which ticks should be visible
off.Verbose

Turn off the output
getBuiltinDate.GString

Gets the current date
TextStatusBar

A status bar at the R prompt that can be updated
attachLocally.list

Assigns an objects elements locally
enter.Verbose

Writes a message and indents the following output
exit.Verbose

Writes a message and unindents the following output
readByte.Java

Reads a Java formatted byte (8 bits) from a connection
getCharacters.Arguments

Coerces to a character vector and validates
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
createFileAtomically

Creates a file atomically
findSettings.Settings

Searches for the settings file in one or several directories
setProgress.ProgressBar

Sets current progress
readBinFragments

Reads binary data from disjoint sections of a connection or a file
dimNA< -

Sets the dimension of an object with the option to infer one dimension autmatically
summary.Verbose

Generates a summary of an object if above threshold
getInstanceOf.Arguments

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

Creates a grid of subplots
getParent

Gets the string of the parent specified by this pathname
as.character.binmode

Converts a binary/octal/hexadecimal number into a string
getHostname.System

Retrieves the computer name of the current host
intToBin

Converts an integer to a binary/octal/hexadecimal number
print.GString

Prints the processed GString
getOption.Options

Gets an option
moveInSearchPath

Moves a environment in the search path to another position
isModified.Settings

Checks if settings has been modified compared to whats on file
getRaw.GString

Gets the unprocessed GString
filePath

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

Function to call for finalizing the R session
inAnyInterval.numeric

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

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

Writes a timestamp
isAbsolutePath

Checks if this pathname is absolute
getTimestampFormat.Verbose

Gets the default timestamp format
setMaxValue.ProgressBar

Sets maximum value
setLabels.TextStatusBar

Sets new values of given labels
asShort.Java

Converts a numeric to a Java short
validate.SmartComments

Validates the compiled lines
readInt.Java

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

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

Gets a variable value given a name and attributes
renameFile

Renames a file safely
MultiVerbose

A Verbose class ignoring everything
Arguments

Static class to validate and process arguments
VComments

The VComments class
getIntegers.Arguments

Coerces to a integer vector and validates
splitByPattern

Splits a single character string by pattern
asLong.Java

Converts a numeric to a Java long
as.logical.Verbose

Gets a logical value of this object
setValue.ProgressBar

Sets current value
isPackageLoaded

Checks if a package is loaded or not
TimeoutException

TimeoutException represents timeout errors
devIsOpen

Checks if a device is open or not
less.Verbose

Creates a cloned instance with a higher threshold
getThreshold.Verbose

Gets current verbose threshold
isOn.Verbose

Checks if the output is on
getBuiltinRversion.GString

Gets the current R version
loadObject

Method to load object from a file or a connection
writeByte.Java

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

EPS graphics device
evalCapture

Evaluates an expression and captures the code and/or the output
promptAndSave.Settings

Prompt user to save modified settings
hasOption.Options

Checks if an option exists
nbrOfOptions.Options

Gets the number of options set
getVerbose.Arguments

Coerces to Verbose object
loadAnywhere.Settings

Loads settings from file
queryRCmdCheck

Gets the on R CMD check if the current R session was launched by it
as.character.GString

Gets the processed character string
evaluate.Verbose

Evaluates a function and prints its results if above threshold
listDirectory

Gets the file names in the directory
parse.SmartComments

Parses one single smart comment
getLogicals.Arguments

Coerces to a logical vector and validates
patchCode

Patches installed and loaded packages and more
readTable

Reads a file in table format
writeDataFrame.data.frame

Writes a data.frame to tabular text file
isMatrix.Assert

Static method asserting thatan object is a matrix
remove.FileProgressBar

Removes the progress file for a file progress bar
readRdHelp

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

Call hook functions by hook name
flush.TextStatusBar

Flushes the output
compile.SmartComments

Preprocess a vector of code lines
readTableIndex

Reads a single column from file in table format
writeShort.Java

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

The Options class
addFinalizerToLast

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

Methods for creating image files of a specific format
dataFrame

Allocates a data frame with given column classes
findGraphicsDevice.System

Searches for a working PNG device
popTemporaryFile

Drops a temporary suffix from the temporary pathname
mergeIntervals.numeric

Merges intervals
saveAnywhere.Settings

Saves settings to file
capitalize

Capitalizes/decapitalizes each character string in a vector
isFile

Checks if the file specification is a file
writeRaw.Verbose

Writes objects if above threshold
print.Verbose

Prints objects if above threshold
printf

C-style formatted output
getRelativePath

Gets the relative pathname relative to a directory
copyFile

Copies a file safely
isDone.ProgressBar

Checks if progress bar is completed
devSetLabel

Sets the label of a device
isOpen.character

Checks if there is an open connection to a file
stext

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

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

Resets a SmartComments compiler
setStepLength.ProgressBar

Sets default step length
currentTimeMillis.System

Get the current time in milliseconds
capture.Verbose

Captures output of a function
equals.Verbose

Checks if this object is equal to another
getDoubles.Arguments

Coerces to a double vector and validates
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
update.TextStatusBar

Updates the status bar (visually)
devSet

Activates a device
insert

Insert values to a vector at certain positions
commandArgs

Extract Command Line Arguments
detachPackage

Detaches a packages by name
writeInt.Java

Writes a integer (32 bits) to a connection in Java format
getVector.Arguments

Validates a vector
displayCode

Displays the contents of a text file with line numbers and more
getBuiltinRhome.GString

Gets the path where R is installed
isSingle

Identifies all entries that exists exactly ones
isDirectory

Checks if the file specification is a directory
getIndices.Arguments

Coerces to a integer vector and validates
isZero

Checks if a value is (close to) zero or not
downloadFile.character

Downloads a file
newline.TextStatusBar

Writes a newline
timestampOn.Verbose

Turns automatic timestamping on and off
doCall

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

Prints the structure of an object if above threshold
mapToIntervals.numeric

Maps values to intervals
copyDirectory

Copies a directory
reset.ProgressBar

Reset progress bar
devNew

Opens a new device
Java

Static class for Java related methods
getBuiltinPid.GString

Gets the process id of the current R session
getMessage.TimeoutException

Gets the message of the exception
getNumerics.Arguments

Coerces to a numeric vector and validates
jpeg2

A JPEG device for Bitmap Files via GhostScript
getEnvironment.Arguments

Gets an existing environment
getLeaves.Options

Gets all (non-list) options in a flat list
lapply.MultiVerbose

Applies a function to each of the Verbose objects
isUrl

Checks if one or several pathnames is URLs
writeBinFragments

Writes binary data to disjoint sections of a connection or a file
parse.GString

Parses a GString
findSourceTraceback

Finds all 'srcfile' objects generated by source() in all call frames
printf.Verbose

Formats and prints object if above threshold
onGarbageCollect

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

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

Re-assigns a new value to an existing object in a loaded package
colClasses

Creates a vector of column classes used for tabular reading
saveObject

Saves an object to a file or a connection
update.ProgressBar

Updates progress bar
pushState.Verbose

Pushes the current indentation state of the Verbose object
mkdirs

Creates a directory including any necessary but nonexistent parent directories
openBrowser.System

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

Turn on the output
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
readShort.Java

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

Checks if a package is installed or not
setTimestampFormat.Verbose

Sets the default timestamp format
newline.Verbose

Writes one or several empty lines
setThreshold.Verbose

Sets verbose threshold
more.Verbose

Creates a cloned instance with a lower threshold
popMessage.TextStatusBar

Adds a message above the status bar
pushTemporaryFile

Appends a temporary suffix to the pathname
unwrap.array

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

Appends a backup suffix to the pathname
writeRaw.MultiVerbose

Writes to each of the Verbose objects
resample

Sample values from a set of elements
relibrary

Reloads a package
parseDebian.System

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

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

Resets a VComments compiler
str.Options

Prints the structure of the options
toUrl

Converts a pathname into a URL
whichVector.logical

Identifies TRUE elements in a logical vector
writeRaw.NullVerbose

All output methods
setLabel.TextStatusBar

Sets the value of a label
getLabel.TextStatusBar

Gets the current value of a label
ruler.Verbose

Writes a ruler
removeDirectory

Removes a directory
setOption.Options

Sets an option
update.FileProgressBar

Updates file progress bar
NullVerbose

A Verbose class ignoring everything
getBuiltinUsername.GString

Gets the username of the user running R
getAbsolutePath

Gets the absolute pathname string
intervalsToSeq.matrix

Generates a vector of indices from a matrix of intervals
loadToEnv

Method to load objects to a new environment
popBackupFile

Drops a backup suffix from the backup pathname
onSessionExit

Registers a function to be called when the R session finishes
toCamelCase

Converts a string of words into a merged camel-cased word
validate.VComments

Validates the compiled lines
warnings.Verbose

Outputs any warnings recorded
touchFile

Updates the timestamp of a file
wrap.array

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

Sources files recursively to either local or global environment
setOption

Sets a option in R