Learn R Programming

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

R.utils (version 1.3.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

192,589

Version

1.3.3

License

LGPL (>= 2.1)

Maintainer

Henrik Bengtsson

Last Published

February 4th, 2010

Functions in R.utils (1.3.3)

arrayIndex

Converts vector indices to array indices
asLong.Java

Converts a numeric to a Java long
commandArgs

Extract Command Line Arguments
as.logical.Verbose

Gets a logical value of this object
copyDirectory

Copies a directory
as.character.ProgressBar

Gets a string description of the progress bar
as.double.Verbose

Gets a numeric value of this object
R.utils-package

Package R.utils
Arguments

Static class to validate and process arguments
devSet

Activates a device
devList

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

The Assert class
getBuiltinHostname.GString

Gets the hostname of the system running R
getBarString.ProgressBar

Gets the progress bar string to be displayed
asByte.Java

Converts a numeric to a Java byte
getDoubles.Arguments

Coerces to a double vector and validates
MultiVerbose

A Verbose class ignoring everything
enter.Verbose

Writes a message and indents the following output
getBuiltinRversion.GString

Gets the current R version
getEnvironment.Arguments

Gets an existing environment
System

Static class to query information about the system
as.character.Options

Returns a character string version of this object
compile.SmartComments

Preprocess a vector of code lines
getIndices.Arguments

Coerces to a integer vector and validates
colClasses

Creates a vector of column classes used for tabular reading
flush.TextStatusBar

Flushes the output
copyFile

Copies a file safely
TextStatusBar

A status bar at the R prompt that can be updated
getBuiltinTime.GString

Gets the current time
getBuiltinUsername.GString

Gets the username of the user running R
Verbose

Class to writing verbose messages to a connection or file
bunzip2

Bunzip a file
LComments

The LComments class
isMatrix.Assert

Static method asserting thatan object is a matrix
inAnyInterval.numeric

Checks if a set of values are inside one or more intervals
NullVerbose

A Verbose class ignoring everything
VComments

The VComments class
equals.Options

Checks if this object is equal to another Options object
findGhostscript.System

Searches for the ghostview binary on the current system
devIsOpen

Checks if a device is open or not
isModified.Settings

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

Checks if one or several pathnames is URLs
capitalize

Capitalizes/decapitalizes each character string in a vector
as.list.Options

Gets a list representation of the options
getNumerics.Arguments

Coerces to a numeric vector and validates
addFinalizerToLast

Modifies .Last() to call 'finalizeSession()
getLeaves.Options

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

The Options class
getWritablePathname.Arguments

Gets a writable pathname
isAbsolutePath

Checks if this pathname is absolute
capture.Verbose

Captures output of a function
filePath

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

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

Checks if a package is installed or not
isVisible.NullVerbose

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

Provides text based counting progress bar
attachLocally.list

Assigns an objects elements locally
finalizeSession

Function to call for finalizing the R session
Java

Static class for Java related methods
Non-documented objects

Non-documented objects
createWindowsShortcut

Creates a Microsoft Windows Shortcut (.lnk file)
parse.SmartComments

Parses one single smart comment
Settings

Class for applicational settings
callHooks.function

Call hook functions
getBuiltinRhome.GString

Gets the path where R is installed
dimNA< -

Sets the dimension of an object with the option to infer one dimension autmatically
getRegularExpression.Arguments

Gets a valid regular expression pattern
as.character.binmode

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

Abstract class SmartComments
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
convertComment.SmartComments

Converts a single smart comment to R code
mkdirs

Creates a directory including any necessary but nonexistent parent directories
isOn.NullVerbose

Checks if the output is on
getThreshold.Verbose

Gets current verbose threshold
check.Assert

Static method asserting that a generic condition is true
asInt.Java

Converts an numeric to a Java integer
jpeg2

A JPEG device for Bitmap Files via GhostScript
isDirectory

Checks if the file specification is a directory
findGraphicsDevice.System

Searches for a working PNG device
isPackageLoaded

Checks if a package is loaded or not
asShort.Java

Converts a numeric to a Java short
extract.array

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

Detaches a packages by name
print.GString

Prints the processed GString
callHooks

Call hook functions by hook name
devOff

Closes a device
isOpen.character

Checks if there is an open connection to a file
doCall

Executes a function call with option to ignore unused arguments
loadAnywhere.Settings

Loads settings from file
header.Verbose

Writes a header
getAbsolutePath

Gets the absolute pathname string
off.Verbose

Turn off the output
listDirectory

Gets the file names in the directory
getLabel.TextStatusBar

Gets the current value of a label
openBrowser.System

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

Creates a cloned instance with a higher threshold
printf.Verbose

Formats and prints object if above threshold
getVariableValue.GString

Gets a variable value given a name and attributes
intToBin

Converts an integer to a binary/octal/hexadecimal number
mergeIntervals.numeric

Merges intervals
promptAndSave.Settings

Prompt user to save modified settings
more.Verbose

Creates a cloned instance with a lower threshold
getHostname.System

Retrieves the computer name of the current host
onSessionExit

Registers a function to be called when the R session finishes
getUsername.System

Retrieves the name of the user running R
getBuiltinOs.GString

Gets the operating system of the running machine
hasOption.Options

Checks if an option exists
patchCode

Patches installed and loaded packages and more
on.Verbose

Turn on the output
relibrary

Reloads a package
getVerbose.Arguments

Coerces to Verbose object
findSourceTraceback

Finds all 'srcfile' objects generated by source() in all call frames
moveInSearchPath

Moves a environment in the search path to another position
lastModified

Gets the time when the file was last modified
getRelativePath

Gets the relative pathname relative to a directory
exit.Verbose

Writes a message and unindents the following output
reset.VComments

Resets a VComments compiler
isFile

Checks if the file specification is a file
ruler.Verbose

Writes a ruler
pushState.Verbose

Pushes the current indentation state of the Verbose object
png2

A PNG device for Bitmap Files via GhostScript
loadObject

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

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

Sets the current default verbose level
mapToIntervals.numeric

Maps values to intervals
insert

Insert values to a vector at certain positions
updateLabels.TextStatusBar

Sets the new values of given labels and updates the status bar
nbrOfOptions.Options

Gets the number of options set
readShort.Java

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

Checks if progress bar is completed
resetWarnings

Resets recorded warnings
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
reassignInPackage

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

Creates a grid of subplots
readTableIndex

Reads a single column from file in table format
remove.FileProgressBar

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

Gets the current date and time
update.TextStatusBar

Updates the status bar (visually)
touchFile

Updates the timestamp of a file
popMessage.TextStatusBar

Adds a message above the status bar
getIntegers.Arguments

Coerces to a integer vector and validates
update.ProgressBar

Updates progress bar
setOption.Options

Sets an option
isOn.Verbose

Checks if the output is on
toUrl

Converts a pathname into a URL
summary.Verbose

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

Resets a SmartComments compiler
setMaxValue.ProgressBar

Sets maximum value
lapply.MultiVerbose

Applies a function to each of the Verbose objects
devNew

Opens a new device
getOption.Options

Gets an option
writeByte.Java

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

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

Sets new values of given labels
readInt.Java

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

Writes a timestamp
getInstanceOf.Arguments

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

Gets the string of the parent specified by this pathname
intervalsToSeq.matrix

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

Gets the process id of the current R session
equals.Verbose

Checks if this object is equal to another
setProgress.ProgressBar

Sets current progress
writeRaw.Verbose

Writes objects if above threshold
newline.TextStatusBar

Writes a newline
getTimestampFormat.Verbose

Gets the default timestamp format
gzip

Gzip/Gunzip a file
newline.Verbose

Writes one or several empty lines
isZero

Checks if a value is (close to) zero or not
readUTF.Java

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

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

Saves an object to a file or a connection
validate.VComments

Validates the compiled lines
isVisible.Verbose

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

Reset progress bar
setTimestampFormat.Verbose

Sets the default timestamp format
str.Options

Prints the structure of the options
seqToIntervals

Gets all contigous intervals of a vector of indices
setLabel.TextStatusBar

Sets the value of a label
setTicks.ProgressBar

Sets values for which ticks should be visible
isVector.Assert

Static method asserting thatan object is a vector
getCharacters.Arguments

Coerces to a character vector and validates
timestampOn.Verbose

Turns automatic timestamping on and off
readBinFragments

Reads binary data from disjoint sections of a connection or a file
writeRaw.NullVerbose

All output methods
sourceDirectory

Sources files recursively to either local or global environment
setStepLength.ProgressBar

Sets default step length
validate.SmartComments

Validates the compiled lines
inherits.Assert

Static method asserting that an object inherits from of a certain class
writeInt.Java

Writes a integer (32 bits) to a connection in Java format
setThreshold.Verbose

Sets verbose threshold
getVector.Arguments

Validates a vector
unwrap.array

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

Parses and evaluates code from a file or a connection
increase.ProgressBar

Increases (steps) progress bar
getReadablePathnames.Arguments

Gets a readable pathname
splitByPattern

Splits a single character string by pattern
toCamelCase

Converts a string of words into a merged camel-cased word
wrap.array

Reshape an array or a matrix by permuting and/or joining dimensions
setValue.ProgressBar

Sets current value
writeShort.Java

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

Closes an on-screen (interactive) device
loadToEnv

Method to load objects to a new environment
findSettings.Settings

Searches for the settings file in one or several directories
readTable

Reads a file in table format
parseDebian.System

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

Removes a directory
warnings.Verbose

Outputs any warnings recorded
writeUTF.Java

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

A progress bar that sets the size of a file accordingly
as.character.Verbose

Returns a character string version of this object
as.character.GString

Gets the processed character string
countLines

Counts the number of lines in a text file
currentTimeMillis.System

Get the current time in milliseconds
devGetLabel

Gets the label of a device
cat.Verbose

Concatenates and prints objects if above threshold
convertComment.VComments

Converts a verbose comment to R code
eps

EPS graphics device
evaluate.Verbose

Evaluates a function and prints its results if above threshold
fileAccess

Checks the permission of a file or a directory
getBuiltinDate.GString

Gets the current date
getLogicals.Arguments

Coerces to a logical vector and validates
saveAnywhere.Settings

Saves settings to file
str.Verbose

Prints the structure of an object if above threshold
writeBinFragments

Writes binary data to disjoint sections of a connection or a file
update.FileProgressBar

Updates file progress bar
writeRaw.MultiVerbose

Writes to each of the Verbose objects
createLink

Creates a link to a file or a directory
devSetLabel

Sets the label of a device
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
isEof.connection

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

Static method asserting thatan object is a single value
GString

Character string with advanced substitutions
Sys.setenv

Sys.setenv
dataFrame

Allocates a data frame with given column classes
getReadablePathname.Arguments

Gets a readable pathname
getRaw.GString

Gets the unprocessed GString
parse.GString

Parses a GString
print.Verbose

Prints objects if above threshold
whichVector.logical

Identifies TRUE elements in a logical vector