Learn R Programming

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

R.utils (version 1.7.2)

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

License

LGPL (>= 2.1)

Maintainer

Henrik Bengtsson

Last Published

March 24th, 2011

Functions in R.utils (1.7.2)

enter.Verbose

Writes a message and indents the following output
as.double.Verbose

Gets a numeric value of this object
currentTimeMillis.System

Get the current time in milliseconds
getRaw.GString

Gets the unprocessed GString
NullVerbose

A Verbose class ignoring everything
TextStatusBar

A status bar at the R prompt that can be updated
getHostname.System

Retrieves the computer name of the current host
System

Static class to query information about the system
callHooks

Call hook functions by hook name
arrayIndex

Converts vector indices to array indices
Settings

Class for applicational settings
cat.Verbose

Concatenates and prints objects if above threshold
countLines

Counts the number of lines in a text file
createFileAtomically

Creates a file atomically
SmartComments

Abstract class SmartComments
filePath

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

Static method asserting thatan object is a vector
convertComment.VComments

Converts a verbose comment to R code
devList

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

Class to writing verbose messages to a connection or file
devDone

Closes an open device unless it is a on-screen (interactive) device
getBuiltinRhome.GString

Gets the path where R is installed
getBuiltinDatetime.GString

Gets the current date and time
insert

Insert values to a vector at certain positions
findGhostscript.System

Searches for the ghostview binary on the current system
as.character.binmode

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

Converts a numeric to a Java short
exit.Verbose

Writes a message and unindents the following output
readUTF.Java

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

Static class to validate and process arguments
getBuiltinUsername.GString

Gets the username of the user running R
addFinalizerToLast

Modifies .Last() to call 'finalizeSession()
saveAnywhere.Settings

Saves settings to file
asLong.Java

Converts a numeric to a Java long
doCall

Executes a function call with option to ignore unused arguments
getCharacters.Arguments

Coerces to a character vector and validates
as.list.Options

Gets a list representation of the options
asByte.Java

Converts a numeric to a Java byte
equals.Verbose

Checks if this object is equal to another
fileAccess

Checks the permission of a file or a directory
isPackageInstalled

Checks if a package is installed or not
subplots

Creates a grid of subplots
getReadablePathnames.Arguments

Gets a readable pathname
attachLocally.list

Assigns an objects elements locally
loadToEnv

Method to load objects to a new environment
readByte.Java

Reads a Java formatted byte (8 bits) from a connection
equals.Options

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

Searches for a working PNG device
getDoubles.Arguments

Coerces to a double vector and validates
setProgress.ProgressBar

Sets current progress
intervalsToSeq.matrix

Generates a vector of indices from a matrix of intervals
getAbsolutePath

Gets the absolute pathname string
isMatrix.Assert

Static method asserting thatan object is a matrix
isFile

Checks if the file specification is a file
getInstanceOf.Arguments

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

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

Writes a header
setTimestampFormat.Verbose

Sets the default timestamp format
setValue.ProgressBar

Sets current value
inherits.Assert

Static method asserting that an object inherits from of a certain class
as.character.ProgressBar

Gets a string description of the progress bar
isOpen.character

Checks if there is an open connection to a file
timestamp.Verbose

Writes a timestamp
lapply.MultiVerbose

Applies a function to each of the Verbose objects
readRdHelp

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

Activates a device
evaluate.Verbose

Evaluates a function and prints its results if above threshold
Assert

The Assert class
stext

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

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

Updates the timestamp of a file
relibrary

Reloads a package
jpeg2

A JPEG device for Bitmap Files via GhostScript
R.utils-package

Package R.utils
getBuiltinRversion.GString

Gets the current R version
lastModified

Gets the time when the file was last modified
TimeoutException

TimeoutException represents timeout errors
convertComment.SmartComments

Converts a single smart comment to R code
callHooks.function

Call hook functions
isDone.ProgressBar

Checks if progress bar is completed
isModified.Settings

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

Creates a Microsoft Windows Shortcut (.lnk file)
devGetLabel

Gets the label of a device
getVariableValue.GString

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

Turn off the output
downloadFile.character

Downloads a file
isOn.Verbose

Checks if the output is on
mkdirs

Creates a directory including any necessary but nonexistent parent directories
devSetLabel

Sets the label of a device
hasOption.Options

Checks if an option exists
isEof.connection

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

Reset progress bar
moveInSearchPath

Moves a environment in the search path to another position
getBuiltinHostname.GString

Gets the hostname of the system running R
getBuiltinPid.GString

Gets the process id of the current R session
MultiVerbose

A Verbose class ignoring everything
getRelativePath

Gets the relative pathname relative to a directory
getBuiltinDate.GString

Gets the current date
ProgressBar

Provides text based counting progress bar
setDefaultLevel.Verbose

Sets the current default verbose level
getLogicals.Arguments

Coerces to a logical vector and validates
FileProgressBar

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

Coerces to a integer vector and validates
isScalar.Assert

Static method asserting thatan object is a single value
mapToIntervals.numeric

Maps values to intervals
newline.TextStatusBar

Writes a newline
pushTemporaryFile

Appends a temporary suffix to the pathname
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
listDirectory

Gets the file names in the directory
isAbsolutePath

Checks if this pathname is absolute
devIsOpen

Checks if a device is open or not
mergeIntervals.numeric

Merges intervals
commandArgs

Extract Command Line Arguments
env

Creates a new environment, evaluates an expression therein, and returns the environment
isVisible.NullVerbose

Checks if a certain verbose level will be shown or not
isOn.NullVerbose

Checks if the output is on
findSourceTraceback

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

Renames a file safely
unwrap.array

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

Checks if a package is loaded or not
parse.GString

Parses a GString
pushState.Verbose

Pushes the current indentation state of the Verbose object
readBinFragments

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

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

Drops a backup suffix from the backup pathname
removeDirectory

Removes a directory
names.Options

Gets the full pathname of all (non-list) options
isVisible.Verbose

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

Re-assigns a new value to an existing object in a loaded package
update.TextStatusBar

Updates the status bar (visually)
colClasses

Creates a vector of column classes used for tabular reading
detachPackage

Detaches a packages by name
getLabel.TextStatusBar

Gets the current value of a label
getTimestampFormat.Verbose

Gets the default timestamp format
GString

Character string with advanced substitutions
as.character.GString

Gets the processed character string
setOption

Sets a option in R
createLink

Creates a link to a file or a directory
getRegularExpression.Arguments

Gets a valid regular expression pattern
validate.VComments

Validates the compiled lines
summary.Verbose

Generates a summary of an object if above threshold
displayCode

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

Checks if one or several pathnames is URLs
printf

C-style formatted output
print.Verbose

Prints objects if above threshold
dimNA< -

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

Copies a file safely
str.Verbose

Prints the structure of an object if above threshold
promptAndSave.Settings

Prompt user to save modified settings
onSessionExit

Registers a function to be called when the R session finishes
updateLabels.TextStatusBar

Sets the new values of given labels and updates the status bar
validate.SmartComments

Validates the compiled lines
extract.array

Extract a subset of an array, matrix or a vector with unknown dimensions
more.Verbose

Creates a cloned instance with a lower threshold
as.character.Verbose

Returns a character string version of this object
writeRaw.MultiVerbose

Writes to each of the Verbose objects
whichVector.logical

Identifies TRUE elements in a logical vector
getBarString.ProgressBar

Gets the progress bar string to be displayed
getUsername.System

Retrieves the name of the user running R
as.logical.Verbose

Gets a logical value of this object
update.FileProgressBar

Updates file progress bar
setThreshold.Verbose

Sets verbose threshold
loadObject

Method to load object from a file or a connection
Non-documented objects

Non-documented objects
writeRaw.NullVerbose

All output methods
setLabel.TextStatusBar

Sets the value of a label
loadAnywhere.Settings

Loads settings from file
on.Verbose

Turn on the output
readTable

Reads a file in table format
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
capture.Verbose

Captures output of a function
VComments

The VComments class
compile.SmartComments

Preprocess a vector of code lines
newline.Verbose

Writes one or several empty lines
getEnvironment.Arguments

Gets an existing environment
sourceTo

Parses and evaluates code from a file or a connection
setOption.Options

Sets an option
getIntegers.Arguments

Coerces to a integer vector and validates
splitByPattern

Splits a single character string by pattern
png2

A PNG device for Bitmap Files via GhostScript
pushBackupFile

Appends a backup suffix to the pathname
finalizeSession

Function to call for finalizing the R session
openBrowser.System

Opens an HTML document using the OS default HTML browser
gzip

Gzip/Gunzip a file
getThreshold.Verbose

Gets current verbose threshold
as.character.Options

Returns a character string version of this object
getOption.Options

Gets an option
ruler.Verbose

Writes a ruler
remove.FileProgressBar

Removes the progress file for a file progress bar
timestampOn.Verbose

Turns automatic timestamping on and off
less.Verbose

Creates a cloned instance with a higher threshold
seqToIntervals

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

Resets a SmartComments compiler
toCamelCase

Converts a string of words into a merged camel-cased word
getBuiltinTime.GString

Gets the current time
isDirectory

Checks if the file specification is a directory
str.Options

Prints the structure of the options
dataFrame

Allocates a data frame with given column classes
getReadablePathname.Arguments

Gets a readable pathname
writeInt.Java

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

Gets the string of the parent specified by this pathname
getMessage.TimeoutException

Gets the message of the exception
wrap.array

Reshape an array or a matrix by permuting and/or joining dimensions
popMessage.TextStatusBar

Adds a message above the status bar
setLabels.TextStatusBar

Sets new values of given labels
getLeaves.Options

Gets all (non-list) options in a flat list
getNumerics.Arguments

Coerces to a numeric vector and validates
getVerbose.Arguments

Coerces to Verbose object
reset.VComments

Resets a VComments compiler
warnings.Verbose

Outputs any warnings recorded
devOff

Closes a device
getWritablePathname.Arguments

Gets a writable pathname
inAnyInterval.numeric

Checks if a set of values are inside one or more intervals
writeRaw.Verbose

Writes objects if above threshold
setStepLength.ProgressBar

Sets default step length
bunzip2

Bunzip a file
flush.TextStatusBar

Flushes the output
writeByte.Java

Writes a byte (8 bits) to a connection in Java format
increase.ProgressBar

Increases (steps) progress bar
devNew

Opens a new device
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
getVector.Arguments

Validates a vector
isZero

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

Resets recorded warnings
parseDebian.System

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

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

Converts a pathname into a URL
print.GString

Prints the processed GString
writeUTF.Java

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

Capitalizes/decapitalizes each character string in a vector
Java

Static class for Java related methods
readInt.Java

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

Saves an object to a file or a connection
devEval

Opens a new device, evaluate (graphing) code, and closes device
popTemporaryFile

Drops a temporary suffix from the temporary pathname
nbrOfOptions.Options

Gets the number of options set
findSettings.Settings

Searches for the settings file in one or several directories
sourceDirectory

Sources files recursively to either local or global environment
parse.SmartComments

Parses one single smart comment
writeShort.Java

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

Formats and prints object if above threshold
update.ProgressBar

Updates progress bar
patchCode

Patches installed and loaded packages and more
readShort.Java

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

Sets values for which ticks should be visible
Options

The Options class
LComments

The LComments class
check.Assert

Static method asserting that a generic condition is true
copyDirectory

Copies a directory
evalWithTimeout

Evaluate an R expression and interrupts it if it takes too long
asInt.Java

Converts an numeric to a Java integer
eps

EPS graphics device
getBuiltinOs.GString

Gets the operating system of the running machine
resample

Sample values from a set of elements
readTableIndex

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

Sets maximum value