Learn R Programming

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

R.utils (version 1.27.1)

Various programming utilities

Description

This package provides utility methods useful when programming and developing R packages.

Copy Link

Version

Install

install.packages('R.utils')

Monthly Downloads

163,892

Version

1.27.1

License

LGPL (>= 2.1)

Maintainer

Henrik Bengtsson

Last Published

September 15th, 2013

Functions in R.utils (1.27.1)

TimeoutException

TimeoutException represents timeout errors
Options

The Options class
as.character.binmode

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

A Verbose class ignoring everything
SmartComments

Abstract class SmartComments
attachLocally.list

Assigns an objects elements locally
bunzip2

Bunzip a file
Java

Static class for Java related methods
capitalize

Capitalizes/decapitalizes each character string in a vector
FileProgressBar

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

Static class to query information about the system
Java$asByte

Converts a numeric to a Java byte
Settings

Class for applicational settings
displayCode

Displays the contents of a text file with line numbers and more
Java$asShort

Converts a numeric to a Java short
evalWithTimeout

Evaluate an R expression and interrupts it if it takes too long
Non-documented objects

Non-documented objects
callHooks.function

Call hook functions
detachPackage

Detaches a packages by name
findSourceTraceback

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

Returns a character string version of this object
GString$getVariableValue

Gets a variable value given a name and attributes
GString$getBuiltinDate

Gets the current date
Assert

The Assert class
newline.Verbose

Writes one or several empty lines
as.list.MultiVerbose

Gets a list of Verbose objects
copyFile

Copies a file safely
arrayIndex

Converts vector indices to array indices
gcat

Parses, evaluates and outputs a GString
increase.ProgressBar

Increases (steps) progress bar
Java$asLong

Converts a numeric to a Java long
evalCapture

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

Creates a Microsoft Windows Shortcut (.lnk file)
cleanup.FileProgressBar

Removes the progress file for a file progress bar
getOption.Options

Gets an option
isOpen.character

Checks if there is an open connection to a file
installPackages

Install R packages by name or URL
TextStatusBar

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

Gets a list representation of the options
createFileAtomically

Creates a file atomically
as.logical.Verbose

Gets a logical value of this object
cat.Verbose

Concatenates and prints objects if above threshold
Java$asInt

Converts an numeric to a Java integer
R.utils-package

Package R.utils
equals.Options

Checks if this object is equal to another Options object
hpaste

Concatenating vectors into human-readable strings
doCall

Executes a function call with option to ignore unused arguments
commandArgs

Extract command-line arguments
filePath

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

Modifies .Last() to call 'finalizeSession()
flush.TextStatusBar

Flushes the output
GString$getBuiltinHostname

Gets the hostname of the system running R
less.Verbose

Creates a cloned instance with a higher threshold
createLink

Creates a link to a file or a directory
findFiles

Finds one or several files in multiple directories
System$getUsername

Retrieves the name of the user running R
finalizeSession

Function to call for finalizing the R session
Arguments

Static class to validate and process arguments
System$findGraphicsDevice

Searches for a working PNG device
countLines

Counts the number of lines in a text file
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
callHooks

Call hook functions by hook name
Arguments$getFilename

Gets and validates a filename
as.character.Options

Returns a character string version of this object
getRaw.GString

Gets the unprocessed GString
getTimestampFormat.Verbose

Gets the default timestamp format
Arguments$getLogicals

Coerces to a logical vector and validates
Arguments$getVector

Validates a vector
convertComment.VComments

Converts a verbose comment to R code
as.double.Verbose

Gets a numeric value of this object
downloadFile.character

Downloads a file
Arguments$getRegularExpression

Gets a valid regular expression pattern
isOn.Verbose

Checks if the output is on
exit.Verbose

Writes a message and unindents the following output
GString$getBuiltinPid

Gets the process id of the current R session
extract.array

Extract a subset of an array, matrix or a vector with unknown dimensions
Assert$inherits

Static method asserting that an object inherits from of a certain class
GString$getBuiltinUsername

Gets the username of the user running R
getAbsolutePath

Gets the absolute pathname string
MultiVerbose

A Verbose class ignoring everything
gzip

Gzip/Gunzip a file
dataFrame

Allocates a data frame with given column classes
Arguments$getDoubles

Coerces to a double vector and validates
System$findGhostscript

Searches for a Ghostview executable on the current system
GString$getBuiltinRhome

Gets the path where R is installed
getParent

Gets the string of the parent specified by this pathname
onSessionExit

Registers a function to be called when the R session finishes
Arguments$getWritablePathname

Gets a writable pathname
getBarString.ProgressBar

Gets the progress bar string to be displayed
isSingle

Identifies all entries that exists exactly ones
ProgressBar

Provides text based counting progress bar
colClasses

Creates a vector of column classes used for tabular reading
Verbose

Class to writing verbose messages to a connection or file
GString

Character string with advanced substitutions
hasOption.Options

Checks if an option exists
isVisible.NullVerbose

Checks if a certain verbose level will be shown or not
more.Verbose

Creates a cloned instance with a lower threshold
readTable

Reads a file in table format
off.Verbose

Turn off the output
pushBackupFile

Appends a backup suffix to the pathname
System$currentTimeMillis

Get the current time in milliseconds
loadAnywhere.Settings

Loads settings from file
setLabels.TextStatusBar

Sets new values of given labels
inAnyInterval.numeric

Checks if a set of values are inside one or more intervals
draw.density

Draws a density curve
GString$getBuiltinOs

Gets the operating system of the running machine
isAbsolutePath

Checks if this pathname is absolute
Settings$findSettings

Searches for the settings file in one or several directories
Arguments$getInstanceOf

Gets an instance of the object that is of a particular class
equals.Verbose

Checks if this object is equal to another
parse.SmartComments

Parses one single smart comment
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
System$getHostname

Retrieves the computer name of the current host
Arguments$getCharacters

Coerces to a character vector and validates
GString$getBuiltinDatetime

Gets the current date and time
Java$readUTF

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

Insert values to a vector at certain positions
isUrl

Checks if one or several pathnames is URLs
isPackageLoaded

Checks if a package is loaded or not
Arguments$getIntegers

Coerces to a integer vector and validates
isEof.connection

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

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

Gets the on R CMD check if the current R session was launched by it
GString$getBuiltinTime

Gets the current time
removeDirectory

Removes a directory
setValue.ProgressBar

Sets current value
env

Creates a new environment, evaluates an expression therein, and returns the environment
names.Options

Gets the full pathname of all (non-list) options
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
Assert$isMatrix

Static method asserting thatan object is a matrix
popTemporaryFile

Drops a temporary suffix from the temporary pathname
moveInSearchPath

Moves a environment in the search path to another position
on.Verbose

Turn on the output
getMessage.TimeoutException

Gets the message of the exception
stext

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

Resets recorded warnings
isZero

Checks if a value is (close to) zero or not
reset.SmartComments

Resets a SmartComments compiler
Java$writeInt

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

Sets the default timestamp format
mapToIntervals.numeric

Maps values to intervals
evaluate.GString

Parses and evaluates a GString
popMessage.TextStatusBar

Adds a message above the status bar
seqToHumanReadable

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

Static method asserting thatan object is a single value
Java$readInt

Reads a Java formatted int (32 bits) from a connection
validate.SmartComments

Validates the compiled lines
nbrOfOptions.Options

Gets the number of options set
mergeIntervals.numeric

Merges intervals
Assert$isVector

Static method asserting thatan object is a vector
sourceTo

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

Sets values for which ticks should be visible
unwrap.array

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

Patches installed and loaded packages and more
getLeaves.Options

Gets all (non-list) options in a flat list
Java$readShort

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

Method to load object from a file or a connection
setThreshold.Verbose

Sets verbose threshold
getRelativePath

Gets the relative pathname relative to a directory
swapXY.density

Swaps x and y coordinates of a density object
Arguments$getReadablePathnames

Gets a readable pathname
toUrl

Converts a pathname into a URL
isDone.ProgressBar

Checks if progress bar is completed
intToBin

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

Identifies all entries with replicated values
evaluate.Verbose

Evaluates a function and prints its results if above threshold
promptAndSave.Settings

Prompt user to save modified settings
loadToEnv

Method to load objects to a new environment
readWindowsShellLink

Reads a Microsoft Windows Shortcut (.lnk file)
Java$writeByte

Writes a byte (8 bits) to a connection in Java format
intervalsToSeq.matrix

Generates a vector of indices from a matrix of intervals
listDirectory

Gets the file names in the directory
print.GString

Prints the processed GString
isFile

Checks if the file specification is a file
isDirectory

Checks if the file specification is a directory
isOn.NullVerbose

Checks if the output is on
setDefaultLevel.Verbose

Sets the current default verbose level
subplots

Creates a grid of subplots
pushState.Verbose

Pushes the current indentation state of the Verbose object
parse.GString

Parses a GString
seqToIntervals

Gets all contigous intervals of a vector of indices
splitByPattern

Splits a single character string by pattern
readRdHelp

Reads one or more Rd help files in a certain format
getLabel.TextStatusBar

Gets the current value of a label
tempvar

Gets a unique non-existing temporary variable name
timestamp.Verbose

Writes a timestamp
wrap.array

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

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

Sets the value of a label
setStepLength.ProgressBar

Sets default step length
readTableIndex

Reads a single column from file in table format
saveAnywhere.Settings

Saves settings to file
whichVector.logical

Identifies TRUE elements in a logical vector
validate.VComments

Validates the compiled lines
ruler.Verbose

Writes a ruler
GString$getBuiltinRversion

Gets the current R version
renameFile

Renames a file safely
getThreshold.Verbose

Gets current verbose threshold
update.FileProgressBar

Updates file progress bar
toCamelCase

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

Sets a option in R
writeRaw.Verbose

Writes objects if above threshold
readBinFragments

Reads binary data from disjoint sections of a connection or a file
print.Verbose

Prints objects if above threshold
pushTemporaryFile

Appends a temporary suffix to the pathname
System$openBrowser

Opens an HTML document using the OS default HTML browser
Arguments$getReadablePathname

Gets a readable pathname
printf.Verbose

Formats and prints object if above threshold
writeDataFrame.data.frame

Writes a data.frame to tabular text file
sourceDirectory

Sources files recursively to either local or global environment
use

Attaches or loads packages
updateLabels.TextStatusBar

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

Drops a backup suffix from the backup pathname
writeRaw.MultiVerbose

Writes to each of the Verbose objects
Java$readByte

Reads a Java formatted byte (8 bits) from a connection
systemR

Launches another R process from within R
enter.Verbose

Writes a message and indents the following output
System$parseDebian

Parses a string, file or connection for Debian formatted parameters
Java$writeUTF

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

Creates a directory including any necessary but nonexistent parent directories
reassignInPackage

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

Turns automatic timestamping on and off
Arguments$getEnvironment

Gets an existing environment
update.ProgressBar

Updates progress bar
Java$writeShort

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

All output methods
setMaxValue.ProgressBar

Sets maximum value
warnings.Verbose

Outputs any warnings recorded
str.Verbose

Prints the structure of an object if above threshold
saveObject

Saves an object to a file or a connection
Assert$check

Static method asserting that a generic condition is true
cmdArgs

Simple access to parsed command-line arguments
fileAccess

Checks the permission of a file or a directory
Arguments$getNumerics

Coerces to a numeric vector and validates
lastModified

Gets the time when the file was last modified
newline.TextStatusBar

Writes a newline
as.character.ProgressBar

Gets a string description of the progress bar
VComments

The VComments class
copyDirectory

Copies a directory
dimNA< -

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

Gets a variable by name
header.Verbose

Writes a header
isPackageInstalled

Checks if a package is installed or not
isVisible.Verbose

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

C-style formatted output
resample

Sample values from a set of elements
reset.VComments

Resets a VComments compiler
setProgress.ProgressBar

Sets current progress
str.Options

Prints the structure of the options
setOption.Options

Sets an option
update.TextStatusBar

Updates the status bar (visually)
writeBinFragments

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

The LComments class
as.character.GString

Gets the processed character string
convertComment.SmartComments

Converts a single smart comment to R code
capture.Verbose

Captures output of a function
compile.SmartComments

Preprocess a vector of code lines
Arguments$getIndices

Coerces to a integer vector and validates
Arguments$getVerbose

Coerces to Verbose object
reset.ProgressBar

Reset progress bar
touchFile

Updates the timestamp of a file
summary.Verbose

Generates a summary of an object if above threshold