Learn R Programming

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

R.utils (version 1.4.3)

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

License

LGPL (>= 2.1)

Maintainer

Henrik Bengtsson

Last Published

July 3rd, 2010

Functions in R.utils (1.4.3)

arrayIndex

Converts vector indices to array indices
FileProgressBar

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

A Verbose class ignoring everything
Options

The Options class
capture.Verbose

Captures output of a function
devOff

Closes a device
asShort.Java

Converts a numeric to a Java short
as.list.Options

Gets a list representation of the options
commandArgs

Extract Command Line Arguments
equals.Options

Checks if this object is equal to another Options object
VComments

The VComments class
TextStatusBar

A status bar at the R prompt that can be updated
getReadablePathname.Arguments

Gets a readable pathname
LComments

The LComments class
getBarString.ProgressBar

Gets the progress bar string to be displayed
getLabel.TextStatusBar

Gets the current value of a label
dimNA< -

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

Checks the permission of a file or a directory
getEnvironment.Arguments

Gets an existing environment
equals.Verbose

Checks if this object is equal to another
compile.SmartComments

Preprocess a vector of code lines
getAbsolutePath

Gets the absolute pathname string
finalizeSession

Function to call for finalizing the R session
as.character.Options

Returns a character string version of this object
Java

Static class for Java related methods
Non-documented objects

Non-documented objects
findSettings.Settings

Searches for the settings file in one or several directories
getBuiltinUsername.GString

Gets the username of the user running R
displayCode

Displays the contents of a text file with line numbers and more
getUsername.System

Retrieves the name of the user running R
R.utils-package

Package R.utils
extract.array

Extract a subset of an array, matrix or a vector with unknown dimensions
currentTimeMillis.System

Get the current time in milliseconds
isScalar.Assert

Static method asserting thatan object is a single value
getVariableValue.GString

Gets a variable value given a name and attributes
convertComment.SmartComments

Converts a single smart comment to R code
cat.Verbose

Concatenates and prints objects if above threshold
as.character.ProgressBar

Gets a string description of the progress bar
getBuiltinDate.GString

Gets the current date
devSet

Activates a device
addFinalizerToLast

Modifies .Last() to call 'finalizeSession()
evaluate.Verbose

Evaluates a function and prints its results if above threshold
findSourceTraceback

Finds all 'srcfile' objects generated by source() in all call frames
getReadablePathnames.Arguments

Gets a readable pathname
increase.ProgressBar

Increases (steps) progress bar
Verbose

Class to writing verbose messages to a connection or file
isPackageLoaded

Checks if a package is loaded or not
isDirectory

Checks if the file specification is a directory
isDone.ProgressBar

Checks if progress bar is completed
callHooks

Call hook functions by hook name
countLines

Counts the number of lines in a text file
getLogicals.Arguments

Coerces to a logical vector and validates
hasUrlProtocol

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

Gets a numeric value of this object
getCharacters.Arguments

Coerces to a character vector and validates
enter.Verbose

Writes a message and indents the following output
downloadFile.character

Downloads a file
as.logical.Verbose

Gets a logical value of this object
onSessionExit

Registers a function to be called when the R session finishes
getIndices.Arguments

Coerces to a integer vector and validates
getRegularExpression.Arguments

Gets a valid regular expression pattern
getBuiltinRhome.GString

Gets the path where R is installed
devGetLabel

Gets the label of a device
createWindowsShortcut

Creates a Microsoft Windows Shortcut (.lnk file)
print.GString

Prints the processed GString
newline.TextStatusBar

Writes a newline
isVisible.Verbose

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

Method to load object from a file or a connection
getHostname.System

Retrieves the computer name of the current host
isUrl

Checks if one or several pathnames is URLs
eps

EPS graphics device
timestamp.Verbose

Writes a timestamp
moveInSearchPath

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

Prompt user to save modified settings
isModified.Settings

Checks if settings has been modified compared to whats on file
setLabels.TextStatusBar

Sets new values of given labels
loadToEnv

Method to load objects to a new environment
as.character.GString

Gets the processed character string
resetWarnings

Resets recorded warnings
dataFrame

Allocates a data frame with given column classes
exit.Verbose

Writes a message and unindents the following output
filePath

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

Re-assigns a new value to an existing object in a loaded package
findGhostscript.System

Searches for the ghostview binary on the current system
devSetLabel

Sets the label of a device
readBinFragments

Reads binary data from disjoint sections of a connection or a file
getBuiltinPid.GString

Gets the process id of the current R session
getNumerics.Arguments

Coerces to a numeric vector and validates
createLink

Creates a link to a file or a directory
getBuiltinHostname.GString

Gets the hostname of the system running R
setValue.ProgressBar

Sets current value
devDone

Closes an on-screen (interactive) device
SmartComments

Abstract class SmartComments
asLong.Java

Converts a numeric to a Java long
attachLocally.list

Assigns an objects elements locally
callHooks.function

Call hook functions
readShort.Java

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

Static method asserting thatan object is a matrix
readUTF.Java

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

Checks if this pathname is absolute
loadAnywhere.Settings

Loads settings from file
getVerbose.Arguments

Coerces to Verbose object
getParent

Gets the string of the parent specified by this pathname
parse.GString

Parses a GString
mkdirs

Creates a directory including any necessary but nonexistent parent directories
writeShort.Java

Writes a short (16 bits) to a connection in Java format
isOn.NullVerbose

Checks if the output is on
isOpen.character

Checks if there is an open connection to a file
validate.VComments

Validates the compiled lines
lastModified

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

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

Gets the number of options set
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
printf

C-style formatted output
setLabel.TextStatusBar

Sets the value of a label
printf.Verbose

Formats and prints object if above threshold
getTimestampFormat.Verbose

Gets the default timestamp format
mapToIntervals.numeric

Maps values to intervals
capitalize

Capitalizes/decapitalizes each character string in a vector
readByte.Java

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

Updates the status bar (visually)
toCamelCase

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

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

Resets a VComments compiler
wrap.array

Reshape an array or a matrix by permuting and/or joining dimensions
hasOption.Options

Checks if an option exists
parse.SmartComments

Parses one single smart comment
print.Verbose

Prints objects if above threshold
setOption.Options

Sets an option
setTicks.ProgressBar

Sets values for which ticks should be visible
on.Verbose

Turn on the output
setDefaultLevel.Verbose

Sets the current default verbose level
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
more.Verbose

Creates a cloned instance with a lower threshold
setStepLength.ProgressBar

Sets default step length
relibrary

Reloads a package
jpeg2

A JPEG device for Bitmap Files via GhostScript
str.Options

Prints the structure of the options
getWritablePathname.Arguments

Gets a writable pathname
reset.SmartComments

Resets a SmartComments compiler
getIntegers.Arguments

Coerces to a integer vector and validates
getRelativePath

Gets the relative pathname relative to a directory
setMaxValue.ProgressBar

Sets maximum value
getVector.Arguments

Validates a vector
readTableIndex

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

Updates progress bar
reset.ProgressBar

Reset progress bar
whichVector.logical

Identifies TRUE elements in a logical vector
setProgress.ProgressBar

Sets current progress
updateLabels.TextStatusBar

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

A PNG device for Bitmap Files via GhostScript
timestampOn.Verbose

Turns automatic timestamping on and off
intervalsToSeq.matrix

Generates a vector of indices from a matrix of intervals
writeRaw.Verbose

Writes objects if above threshold
writeRaw.NullVerbose

All output methods
getRaw.GString

Gets the unprocessed GString
toUrl

Converts a pathname into a URL
sourceTo

Parses and evaluates code from a file or a connection
parseDebian.System

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

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

Creates a cloned instance with a higher threshold
inAnyInterval.numeric

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

Converts an numeric to a Java integer
flush.TextStatusBar

Flushes the output
popMessage.TextStatusBar

Adds a message above the status bar
as.character.Verbose

Returns a character string version of this object
readTable

Reads a file in table format
writeRaw.MultiVerbose

Writes to each of the Verbose objects
isVisible.NullVerbose

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

Static class to query information about the system
listDirectory

Gets the file names in the directory
str.Verbose

Prints the structure of an object if above threshold
bunzip2

Bunzip a file
getInstanceOf.Arguments

Gets an instance of the object that is of a particular class
validate.SmartComments

Validates the compiled lines
isOn.Verbose

Checks if the output is on
isVector.Assert

Static method asserting thatan object is a vector
off.Verbose

Turn off the output
update.FileProgressBar

Updates file progress bar
subplots

Creates a grid of subplots
openBrowser.System

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

Generates a summary of an object if above threshold
saveAnywhere.Settings

Saves settings to file
newline.Verbose

Writes one or several empty lines
pushState.Verbose

Pushes the current indentation state of the Verbose object
devIsOpen

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

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

Converts a numeric to a Java byte
colClasses

Creates a vector of column classes used for tabular reading
devNew

Opens a new device
getBuiltinRversion.GString

Gets the current R version
intToBin

Converts an integer to a binary/octal/hexadecimal number
splitByPattern

Splits a single character string by pattern
seqToHumanReadable

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

The Assert class
GString

Character string with advanced substitutions
NullVerbose

A Verbose class ignoring everything
ProgressBar

Provides text based counting progress bar
Settings

Class for applicational settings
copyFile

Copies a file safely
convertComment.VComments

Converts a verbose comment to R code
header.Verbose

Writes a header
isFile

Checks if the file specification is a file
getBuiltinDatetime.GString

Gets the current date and time
names.Options

Gets the full pathname of all (non-list) options
remove.FileProgressBar

Removes the progress file for a file progress bar
readInt.Java

Reads a Java formatted int (32 bits) from a connection
sourceDirectory

Sources files recursively to either local or global environment
writeBinFragments

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

Static class to validate and process arguments
check.Assert

Static method asserting that a generic condition is true
devList

Lists the indices of the open devices named by their labels
getBuiltinTime.GString

Gets the current time
getOption.Options

Gets an option
inherits.Assert

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

Gzip/Gunzip a file
insert

Insert values to a vector at certain positions
lapply.MultiVerbose

Applies a function to each of the Verbose objects
patchCode

Patches installed and loaded packages and more
removeDirectory

Removes a directory
saveObject

Saves an object to a file or a connection
writeInt.Java

Writes a integer (32 bits) to a connection in Java format
copyDirectory

Copies a directory
isZero

Checks if a value is (close to) zero or not
getDoubles.Arguments

Coerces to a double vector and validates
getLeaves.Options

Gets all (non-list) options in a flat list
detachPackage

Detaches a packages by name
doCall

Executes a function call with option to ignore unused arguments
findGraphicsDevice.System

Searches for a working PNG device
getThreshold.Verbose

Gets current verbose threshold
getBuiltinOs.GString

Gets the operating system of the running machine
isPackageInstalled

Checks if a package is installed or not
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
mergeIntervals.numeric

Merges intervals
onGarbageCollect

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

Sets verbose threshold
setTimestampFormat.Verbose

Sets the default timestamp format
touchFile

Updates the timestamp of a file
ruler.Verbose

Writes a ruler
warnings.Verbose

Outputs any warnings recorded