Learn R Programming

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

R.utils (version 1.28.4)

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

License

LGPL (>= 2.1)

Maintainer

Henrik Bengtsson

Last Published

November 21st, 2013

Functions in R.utils (1.28.4)

GString$getBuiltinOs

Gets the operating system of the running machine
isDirectory

Checks if the file specification is a directory
Java$readInt

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

Static class for Java related methods
str.Verbose

Prints the structure of an object if above threshold
attachLocally.list

Assigns an objects elements locally
validate.SmartComments

Validates the compiled lines
SmartComments

Abstract class SmartComments
Java$asInt

Converts an numeric to a Java integer
detachPackage

Detaches a packages by name
GString$getBuiltinHostname

Gets the hostname of the system running R
fileAccess

Checks the permission of a file or a directory
System$findGhostscript

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

Gets the username of the user running R
Verbose

Class to writing verbose messages to a connection or file
evalWithTimeout

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

Gets current verbose threshold
GString$getBuiltinTime

Gets the current time
Arguments$getVerbose

Coerces to Verbose object
TextStatusBar

A status bar at the R prompt that can be updated
less.Verbose

Creates a cloned instance with a higher threshold
System$getHostname

Retrieves the computer name of the current host
as.character.binmode

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

Checks if this pathname is absolute
colClasses

Creates a vector of column classes used for tabular reading
hasOption.Options

Checks if an option exists
getRelativePath

Gets the relative pathname relative to a directory
isZero

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

Identifies all entries that exists exactly ones
Java$asByte

Converts a numeric to a Java byte
setOption.Options

Sets an option
hasUrlProtocol

Checks if one or several pathnames has a URL protocol
evalCapture

Evaluates an expression and captures the code and/or the output
timestamp.Verbose

Writes a timestamp
onSessionExit

Registers a function to be called when the R session finishes
cmdArgs

Simple access to parsed command-line arguments
Options

The Options class
as.character.Verbose

Returns a character string version of this object
countLines

Counts the number of lines in a text file
env

Creates a new environment, evaluates an expression therein, and returns the environment
callHooks

Call hook functions by hook name
writeDataFrame.data.frame

Writes a data.frame to tabular text file
readBinFragments

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

Extract command-line arguments
copyFile

Copies a file safely
displayCode

Displays the contents of a text file with line numbers and more
equals.Verbose

Checks if this object is equal to another
Settings$findSettings

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

Checks if this object is equal to another Options object
extract.array

Extract a subset of an array, matrix or a vector with unknown dimensions
Java$asShort

Converts a numeric to a Java short
findFiles

Finds one or several files in multiple directories
as.list.MultiVerbose

Gets a list of Verbose objects
whichVector.logical

Identifies TRUE elements in a logical vector
getOption.Options

Gets an option
GString$getBuiltinPid

Gets the process id of the current R session
Java$readShort

Reads a Java formatted short (16 bits) from a connection
Assert$inherits

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

The Assert class
increase.ProgressBar

Increases (steps) progress bar
as.double.Verbose

Gets a numeric value of this object
evaluate.Verbose

Evaluates a function and prints its results if above threshold
filePath

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

Gets and validates a filename
Java$readUTF

Reads a Java (UTF-8) formatted string from a connection
timestampOn.Verbose

Turns automatic timestamping on and off
getLeaves.Options

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

Drops a temporary suffix from the temporary pathname
getBarString.ProgressBar

Gets the progress bar string to be displayed
System$currentTimeMillis

Get the current time in milliseconds
TimeoutException

TimeoutException represents timeout errors
GString

Character string with advanced substitutions
promptAndSave.Settings

Prompt user to save modified settings
findSourceTraceback

Finds all 'srcfile' objects generated by source() in all call frames
getLoadedPathname.Settings

Gets the pathname of the settings file loaded
pushBackupFile

Appends a backup suffix to the pathname
isFile

Checks if the file specification is a file
System

Static class to query information about the system
GString$getBuiltinRversion

Gets the current R version
isOpen.character

Checks if there is an open connection to a file
as.character.GString

Gets the processed character string
System$getUsername

Retrieves the name of the user running R
isPackageInstalled

Checks if a package is installed or not
isOn.Verbose

Checks if the output is on
Assert$isMatrix

Static method asserting thatan object is a matrix
Arguments

Static class to validate and process arguments
readTable

Reads a file in table format
isPackageLoaded

Checks if a package is loaded or not
R.utils-package

Package R.utils
LComments

The LComments class
createFileAtomically

Creates a file atomically
popMessage.TextStatusBar

Adds a message above the status bar
writeRaw.MultiVerbose

Writes to each of the Verbose objects
insert

Insert values to a vector at certain positions
loadObject

Method to load object from a file or a connection
addFinalizerToLast

Modifies .Last() to call 'finalizeSession()
ProgressBar

Provides text based counting progress bar
Assert$isScalar

Static method asserting thatan object is a single value
reset.VComments

Resets a VComments compiler
pushState.Verbose

Pushes the current indentation state of the Verbose object
createLink

Creates a link to a file or a directory
as.logical.Verbose

Gets a logical value of this object
Arguments$getIndices

Coerces to a integer vector and validates
loadAnywhere.Settings

Loads settings from file
as.list.Options

Gets a list representation of the options
setLabels.TextStatusBar

Sets new values of given labels
isUrl

Checks if one or several pathnames is URLs
mkdirs

Creates a directory including any necessary but nonexistent parent directories
finalizeSession

Function to call for finalizing the R session
listDirectory

Gets the file names in the directory
getAbsolutePath

Gets the absolute pathname string
nbrOfOptions.Options

Gets the number of options set
setMaxValue.ProgressBar

Sets maximum value
Arguments$getReadablePathnames

Gets a readable pathname
readTableIndex

Reads a single column from file in table format
patchCode

Patches installed and loaded packages and more
mergeIntervals.numeric

Merges intervals
convertComment.SmartComments

Converts a single smart comment to R code
setOption

Sets a option in R
doCall

Executes a function call with option to ignore unused arguments
setTicks.ProgressBar

Sets values for which ticks should be visible
isVisible.Verbose

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

Gets all contigous intervals of a vector of indices
Arguments$getRegularExpression

Gets a valid regular expression pattern
dataFrame

Allocates a data frame with given column classes
use

Attaches or loads packages
Arguments$getWritablePathname

Gets a writable pathname
gzip

Gzip/Gunzip a file
installPackages

Install R packages by name or URL
resample

Sample values from a set of elements
flush.TextStatusBar

Flushes the output
unwrap.array

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

Writes binary data to disjoint sections of a connection or a file
Java$writeUTF

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

Reads a Microsoft Windows Shortcut (.lnk file)
removeDirectory

Removes a directory
off.Verbose

Turn off the output
setTimestampFormat.Verbose

Sets the default timestamp format
reset.SmartComments

Resets a SmartComments compiler
header.Verbose

Writes a header
toCamelCase

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

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

Moves a environment in the search path to another position
intToBin

Converts an integer to a binary/octal/hexadecimal number
isDone.ProgressBar

Checks if progress bar is completed
parse.GString

Parses a GString
MultiVerbose

A Verbose class ignoring everything
setDefaultLevel.Verbose

Sets the current default verbose level
as.character.Options

Returns a character string version of this object
Assert$check

Static method asserting that a generic condition is true
isModified.Settings

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

Converts a pathname into a URL
createWindowsShortcut

Creates a Microsoft Windows Shortcut (.lnk file)
Arguments$getEnvironment

Gets an existing environment
getMessage.TimeoutException

Gets the message of the exception
newline.TextStatusBar

Writes a newline
lastModified

Gets the time when the file was last modified
Java$asLong

Converts a numeric to a Java long
arrayIndex

Converts vector indices to array indices
capture.Verbose

Captures output of a function
printf

C-style formatted output
cat.Verbose

Concatenates and prints objects if above threshold
GString$getBuiltinRhome

Gets the path where R is installed
compile.SmartComments

Preprocess a vector of code lines
reset.ProgressBar

Reset progress bar
cleanup.FileProgressBar

Removes the progress file for a file progress bar
Arguments$getIntegers

Coerces to a integer vector and validates
enter.Verbose

Writes a message and indents the following output
intervalsToSeq.matrix

Generates a vector of indices from a matrix of intervals
GString$getBuiltinDatetime

Gets the current date and time
stext

Writes text in the margin along the sides of a plot
Arguments$getVector

Validates a vector
swapXY.density

Swaps x and y coordinates of a density object
writeRaw.NullVerbose

All output methods
update.FileProgressBar

Updates file progress bar
touchFile

Updates the timestamp of a file
Non-documented objects

Non-documented objects
convertComment.VComments

Converts a verbose comment to R code
gcat

Parses, evaluates and outputs a GString
Arguments$getLogicals

Coerces to a logical vector and validates
evaluate.GString

Parses and evaluates a GString
System$findGraphicsDevice

Searches for a working PNG device
Arguments$getInstanceOf

Gets an instance of the object that is of a particular class
setStepLength.ProgressBar

Sets default step length
Arguments$getReadablePathname

Gets a readable pathname
writeRaw.Verbose

Writes objects if above threshold
System$parseDebian

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

Gets the default timestamp format
mapToIntervals.numeric

Maps values to intervals
inAnyInterval.numeric

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

Class for applicational settings
setProgress.ProgressBar

Sets current progress
sourceDirectory

Sources files recursively to either local or global environment
System$openBrowser

Opens an HTML document using the OS default HTML browser
str.Options

Prints the structure of the options
dimNA< -

Sets the dimension of an object with the option to infer one dimension autmatically
getLabel.TextStatusBar

Gets the current value of a label
updateLabels.TextStatusBar

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

Launches another R process from within R
subplots

Creates a grid of subplots
eget

Gets a variable by name
newline.Verbose

Writes one or several empty lines
Java$readByte

Reads a Java formatted byte (8 bits) from a connection
getRaw.GString

Gets the unprocessed GString
names.Options

Gets the full pathname of all (non-list) options
isEof.connection

Checks if the current file position for a connection is at the 'End of File'
tempvar

Gets a unique non-existing temporary variable name
setLabel.TextStatusBar

Sets the value of a label
print.GString

Prints the processed GString
seqToHumanReadable

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

Resets recorded warnings
update.ProgressBar

Updates progress bar
saveObject

Saves an object to a file or a connection
setValue.ProgressBar

Sets current value
parse.SmartComments

Parses one single smart comment
popBackupFile

Drops a backup suffix from the backup pathname
pushTemporaryFile

Appends a temporary suffix to the pathname
saveAnywhere.Settings

Saves settings to file
readRdHelp

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

Splits a single character string by pattern
ruler.Verbose

Writes a ruler
update.TextStatusBar

Updates the status bar (visually)
Java$writeInt

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

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

Capitalizes/decapitalizes each character string in a vector
callHooks.function

Call hook functions
exit.Verbose

Writes a message and unindents the following output
GString$getBuiltinDate

Gets the current date
Arguments$getDoubles

Coerces to a double vector and validates
reassignInPackage

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

Gets the string of the parent specified by this pathname
draw.density

Draws a density curve
downloadFile.character

Downloads a file
loadToEnv

Method to load objects to a new environment
sourceTo

Parses and evaluates code from a file or a connection
VComments

The VComments class
bunzip2

Bunzip a file
NullVerbose

A Verbose class ignoring everything
Arguments$getCharacters

Coerces to a character vector and validates
as.character.ProgressBar

Gets a string description of the progress bar
Arguments$getNumerics

Coerces to a numeric vector and validates
hpaste

Concatenating vectors into human-readable strings
validate.VComments

Validates the compiled lines
GString$getVariableValue

Gets a variable value given a name and attributes
Assert$isVector

Static method asserting thatan object is a vector
printf.Verbose

Formats and prints object if above threshold
queryRCmdCheck

Gets the on R CMD check if the current R session was launched by it
summary.Verbose

Generates a summary of an object if above threshold
onGarbageCollect

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

Turn on the output
isReplicated

Identifies all entries with replicated values
setThreshold.Verbose

Sets verbose threshold
wrap.array

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

Renames a file safely
warnings.Verbose

Outputs any warnings recorded
Java$writeShort

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

Reads a Microsoft Windows Shortcut (.lnk file)
isOn.NullVerbose

Checks if the output is on
isVisible.NullVerbose

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

Prints objects if above threshold
copyDirectory

Copies a directory
more.Verbose

Creates a cloned instance with a lower threshold