Learn R Programming

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

R.utils (version 1.8.5)

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

License

LGPL (>= 2.1)

Maintainer

Henrik Bengtsson

Last Published

October 17th, 2011

Functions in R.utils (1.8.5)

FileProgressBar

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

Gets a logical value of this object
asByte.Java

Converts a numeric to a Java byte
names.Options

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

Static class to query information about the system
asShort.Java

Converts a numeric to a Java short
parse.GString

Parses a GString
currentTimeMillis.System

Get the current time in milliseconds
convertComment.VComments

Converts a verbose comment to R code
addFinalizerToLast

Modifies .Last() to call 'finalizeSession()
attachLocally.list

Assigns an objects elements locally
R.utils-package

Package R.utils
devList

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

Activates a device
getInstanceOf.Arguments

Gets an instance of the object that is of a particular class
readUTF.Java

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

Closes a device
devSetLabel

Sets the label of a device
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
getBuiltinUsername.GString

Gets the username of the user running R
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
getBuiltinRhome.GString

Gets the path where R is installed
getAbsolutePath

Gets the absolute pathname string
setLabel.TextStatusBar

Sets the value of a label
NullVerbose

A Verbose class ignoring everything
getBuiltinOs.GString

Gets the operating system of the running machine
eps

EPS graphics device
copyDirectory

Copies a directory
as.character.Options

Returns a character string version of this object
Non-documented objects

Non-documented objects
displayCode

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

Gets the current date and time
Java

Static class for Java related methods
createFileAtomically

Creates a file atomically
pushTemporaryFile

Appends a temporary suffix to the pathname
getIntegers.Arguments

Coerces to a integer vector and validates
getBarString.ProgressBar

Gets the progress bar string to be displayed
MultiVerbose

A Verbose class ignoring everything
createLink

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

Gets the current R version
asInt.Java

Converts an numeric to a Java integer
LComments

The LComments class
Sys.setenv

Sys.setenv
getLeaves.Options

Gets all (non-list) options in a flat list
as.double.Verbose

Gets a numeric value of this object
getBuiltinPid.GString

Gets the process id of the current R session
getBuiltinTime.GString

Gets the current time
callHooks

Call hook functions by hook name
subplots

Creates a grid of subplots
getDoubles.Arguments

Coerces to a double vector and validates
Settings

Class for applicational settings
devIsOpen

Checks if a device is open or not
fileAccess

Checks the permission of a file or a directory
as.character.Verbose

Returns a character string version of this object
callHooks.function

Call hook functions
as.character.GString

Gets the processed character string
isAbsolutePath

Checks if this pathname is absolute
isPackageInstalled

Checks if a package is installed or not
isOn.NullVerbose

Checks if the output is on
doCall

Executes a function call with option to ignore unused arguments
devEval

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

Static method asserting that a generic condition is true
createWindowsShortcut

Creates a Microsoft Windows Shortcut (.lnk file)
enter.Verbose

Writes a message and indents the following output
TimeoutException

TimeoutException represents timeout errors
getUsername.System

Retrieves the name of the user running R
inAnyInterval.numeric

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

A status bar at the R prompt that can be updated
isPackageLoaded

Checks if a package is loaded or not
VComments

The VComments class
devGetLabel

Gets the label of a device
cat.Verbose

Concatenates and prints objects if above threshold
inherits.Assert

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

Reads a single column from file in table format
getEnvironment.Arguments

Gets an existing environment
update.ProgressBar

Updates progress bar
bunzip2

Bunzip a file
gzip

Gzip/Gunzip a file
saveObject

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

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

Counts the number of lines in a text file
Arguments

Static class to validate and process arguments
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
Assert

The Assert class
as.character.binmode

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

Allocates a data frame with given column classes
writeUTF.Java

Writes a string to a connection in Java format (UTF-8)
hasOption.Options

Checks if an option exists
SmartComments

Abstract class SmartComments
openBrowser.System

Opens an HTML document using the OS default HTML browser
lastModified

Gets the time when the file was last modified
getBuiltinDate.GString

Gets the current date
writeShort.Java

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

Function to call for finalizing the R session
resetWarnings

Resets recorded warnings
setMaxValue.ProgressBar

Sets maximum value
isDirectory

Checks if the file specification is a directory
getBuiltinHostname.GString

Gets the hostname of the system running R
as.character.ProgressBar

Gets a string description of the progress bar
evaluate.Verbose

Evaluates a function and prints its results if above threshold
devDone

Closes an open device unless it is a on-screen (interactive) device
str.Options

Prints the structure of the options
arrayIndex

Converts vector indices to array indices
readByte.Java

Reads a Java formatted byte (8 bits) from a connection
findGhostscript.System

Searches for the ghostview binary on the current system
isEof.connection

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

Writes a message and unindents the following output
asLong.Java

Converts a numeric to a Java long
splitByPattern

Splits a single character string by pattern
jpeg2

A JPEG device for Bitmap Files via GhostScript
printf

C-style formatted output
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
mergeIntervals.numeric

Merges intervals
writeRaw.MultiVerbose

Writes to each of the Verbose objects
validate.SmartComments

Validates the compiled lines
update.FileProgressBar

Updates file progress bar
isFile

Checks if the file specification is a file
timestamp.Verbose

Writes a timestamp
isUrl

Checks if one or several pathnames is URLs
intervalsToSeq.matrix

Generates a vector of indices from a matrix of intervals
onGarbageCollect

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

Detaches a packages by name
getVariableValue.GString

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

Prints the structure of an object if above threshold
extract.array

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

Opens a new device
capitalize

Capitalizes/decapitalizes each character string in a vector
setTimestampFormat.Verbose

Sets the default timestamp format
as.list.Options

Gets a list representation of the options
compile.SmartComments

Preprocess a vector of code lines
summary.Verbose

Generates a summary of an object if above threshold
moveInSearchPath

Moves a environment in the search path to another position
listDirectory

Gets the file names in the directory
mkdirs

Creates a directory including any necessary but nonexistent parent directories
isSingle

Identifies all entries that exists exactly ones
sourceTo

Parses and evaluates code from a file or a connection
getIndices.Arguments

Coerces to a integer vector and validates
patchCode

Patches installed and loaded packages and more
isModified.Settings

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

Removes a directory
seqToHumanReadable

Gets a short human readable string representation of an vector of indices
getThreshold.Verbose

Gets current verbose threshold
getTimestampFormat.Verbose

Gets the default timestamp format
getMessage.TimeoutException

Gets the message of the exception
commandArgs

Extract Command Line Arguments
getHostname.System

Retrieves the computer name of the current host
equals.Verbose

Checks if this object is equal to another
isReplicated

Identifies all entries with replicated values
lapply.MultiVerbose

Applies a function to each of the Verbose objects
copyFile

Copies a file safely
isScalar.Assert

Static method asserting thatan object is a single value
setOption

Sets a option in R
getCharacters.Arguments

Coerces to a character vector and validates
getRaw.GString

Gets the unprocessed GString
getParent

Gets the string of the parent specified by this pathname
toCamelCase

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

Sets an option
findSourceTraceback

Finds all 'srcfile' objects generated by source() in all call frames
convertComment.SmartComments

Converts a single smart comment to R code
reset.SmartComments

Resets a SmartComments compiler
env

Creates a new environment, evaluates an expression therein, and returns the environment
findSettings.Settings

Searches for the settings file in one or several directories
equals.Options

Checks if this object is equal to another Options object
isOpen.character

Checks if there is an open connection to a file
isDone.ProgressBar

Checks if progress bar is completed
getOption.Options

Gets an option
writeBinFragments

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

Coerces to Verbose object
getNumerics.Arguments

Coerces to a numeric vector and validates
isVector.Assert

Static method asserting thatan object is a vector
increase.ProgressBar

Increases (steps) progress bar
whichVector.logical

Identifies TRUE elements in a logical vector
unwrap.array

Unwrap an array, matrix or a vector to an array of more dimensions
parseDebian.System

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

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

Method to load objects to a new environment
hpaste

Concatenating vectors into human-readable strings
update.TextStatusBar

Updates the status bar (visually)
less.Verbose

Creates a cloned instance with a higher threshold
parse.SmartComments

Parses one single smart comment
getReadablePathnames.Arguments

Gets a readable pathname
colClasses

Creates a vector of column classes used for tabular reading
insert

Insert values to a vector at certain positions
readBinFragments

Reads binary data from disjoint sections of a connection or a file
getLogicals.Arguments

Coerces to a logical vector and validates
pushBackupFile

Appends a backup suffix to the pathname
loadObject

Method to load object from a file or a connection
getLabel.TextStatusBar

Gets the current value of a label
sourceDirectory

Sources files recursively to either local or global environment
GString

Character string with advanced substitutions
Options

The Options class
more.Verbose

Creates a cloned instance with a lower threshold
onSessionExit

Registers a function to be called when the R session finishes
on.Verbose

Turn on the output
off.Verbose

Turn off the output
writeDataFrame.data.frame

Writes a data.frame to tabular text file
getRegularExpression.Arguments

Gets a valid regular expression pattern
png2

A PNG device for Bitmap Files via GhostScript
ProgressBar

Provides text based counting progress bar
dimNA< -

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

Class to writing verbose messages to a connection or file
setValue.ProgressBar

Sets current value
header.Verbose

Writes a header
findGraphicsDevice.System

Searches for a working PNG device
remove.FileProgressBar

Removes the progress file for a file progress bar
readRdHelp

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

Reads a file in table format
getRelativePath

Gets the relative pathname relative to a directory
popBackupFile

Drops a backup suffix from the backup pathname
promptAndSave.Settings

Prompt user to save modified settings
isOn.Verbose

Checks if the output is on
capture.Verbose

Captures output of a function
downloadFile.character

Downloads a file
newline.Verbose

Writes one or several empty lines
popTemporaryFile

Drops a temporary suffix from the temporary pathname
isMatrix.Assert

Static method asserting thatan object is a matrix
setLabels.TextStatusBar

Sets new values of given labels
evalWithTimeout

Evaluate an R expression and interrupts it if it takes too long
ruler.Verbose

Writes a ruler
nbrOfOptions.Options

Gets the number of options set
printf.Verbose

Formats and prints object if above threshold
print.GString

Prints the processed GString
touchFile

Updates the timestamp of a file
readWindowsShortcut

Reads a Microsoft Windows Shortcut (.lnk file)
toUrl

Converts a pathname into a URL
isVisible.NullVerbose

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

Reloads a package
saveAnywhere.Settings

Saves settings to file
updateLabels.TextStatusBar

Sets the new values of given labels and updates the status bar
reset.ProgressBar

Reset progress bar
print.Verbose

Prints objects if above threshold
reset.VComments

Resets a VComments compiler
setTicks.ProgressBar

Sets values for which ticks should be visible
setDefaultLevel.Verbose

Sets the current default verbose level
seqToIntervals

Gets all contigous intervals of a vector of indices
mapToIntervals.numeric

Maps values to intervals
setProgress.ProgressBar

Sets current progress
stext

Writes text in the margin along the sides of a plot
wrap.array

Reshape an array or a matrix by permuting and/or joining dimensions
validate.VComments

Validates the compiled lines
pushState.Verbose

Pushes the current indentation state of the Verbose object
writeRaw.NullVerbose

All output methods
flush.TextStatusBar

Flushes the output
getVector.Arguments

Validates a vector
renameFile

Renames a file safely
intToBin

Converts an integer to a binary/octal/hexadecimal number
getReadablePathname.Arguments

Gets a readable pathname
popMessage.TextStatusBar

Adds a message above the status bar
getWritablePathname.Arguments

Gets a writable pathname
loadAnywhere.Settings

Loads settings from file
newline.TextStatusBar

Writes a newline
resample

Sample values from a set of elements
setThreshold.Verbose

Sets verbose threshold
timestampOn.Verbose

Turns automatic timestamping on and off
setStepLength.ProgressBar

Sets default step length
writeInt.Java

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

Outputs any warnings recorded
writeRaw.Verbose

Writes objects if above threshold
writeByte.Java

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