RDocumentation
Moon
Learn R
Search all packages and functions
⚠️
There's a newer version (2.12.3) of this package.
Take me there.
R.utils (version 1.12.0)
Various programming utilities
Description
This package provides utility classes and methods useful when programming in R and developing R packages.
Copy Link
Copy
Link to current version
Version
Version
2.12.3
2.12.2
2.12.1
2.12.0
2.11.0
2.10.1
2.9.2
2.9.1
2.9.0
2.8.0
2.7.0
2.6.0
2.5.0
2.4.0
2.3.0
2.2.0
2.1.0
2.0.2
2.0.1
2.0.0
1.34.0
1.33.0
1.32.4
1.29.8
1.28.4
1.27.1
1.26.2
1.26.0
1.25.2
1.23.2
1.19.5
1.19.3
1.18.0
1.16.2
1.16.0
1.12.1
1.12.0
1.9.11
1.9.9
1.9.7
1.9.6
1.9.4
1.9.3
1.8.7
1.8.5
1.8.2
1.8.1
1.7.8
1.7.7
1.7.5
1.7.4
1.7.3
1.7.2
1.7.0
1.6.5
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.8
1.5.7
1.5.6
1.5.3
1.5.2
1.5.0
1.4.4
1.4.3
1.4.2
1.4.0
1.3.3
1.3.2
1.3.0
1.2.4
1.2.2
1.2.0
1.1.7
1.1.1
1.1.0
1.0.1
0.9.8
0.9.7
0.9.6
0.9.5
0.9.1
0.9.0
0.8.9
0.8.0
0.7.9
0.7.7
0.5.5
Down Chevron
Install
install.packages('R.utils')
Monthly Downloads
208,068
Version
1.12.0
License
LGPL (>= 2.1)
Maintainer
Henrik Bengtsson
Last Published
March 19th, 2012
Functions in R.utils (1.12.0)
Search functions
devOff
Closes a device
asInt.Java
Converts an numeric to a Java integer
enter.Verbose
Writes a message and indents the following output
TimeoutException
TimeoutException represents timeout errors
check.Assert
Static method asserting that a generic condition is true
capture.Verbose
Captures output of a function
asShort.Java
Converts a numeric to a Java short
devList
Lists the indices of the open devices named by their labels
Arguments
Static class to validate and process arguments
as.list.Options
Gets a list representation of the options
VComments
The VComments class
NullVerbose
A Verbose class ignoring everything
devSet
Activates a device
getBuiltinRhome.GString
Gets the path where R is installed
as.logical.Verbose
Gets a logical value of this object
off.Verbose
Turn off the output
getAbsolutePath
Gets the absolute pathname string
System
Static class to query information about the system
as.character.GString
Gets the processed character string
evaluate.Verbose
Evaluates a function and prints its results if above threshold
cleanup.FileProgressBar
Removes the progress file for a file progress bar
Verbose
Class to writing verbose messages to a connection or file
getBuiltinRversion.GString
Gets the current R version
as.character.Verbose
Returns a character string version of this object
getTimestampFormat.Verbose
Gets the default timestamp format
env
Creates a new environment, evaluates an expression therein, and returns the environment
getThreshold.Verbose
Gets current verbose threshold
as.character.binmode
Converts a binary/octal/hexadecimal number into a string
getBuiltinPid.GString
Gets the process id of the current R session
downloadFile.character
Downloads a file
equals.Options
Checks if this object is equal to another Options object
arrayIndex
Converts vector indices to array indices
devGetLabel
Gets the label of a device
as.double.Verbose
Gets a numeric value of this object
SmartComments
Abstract class SmartComments
currentTimeMillis.System
Get the current time in milliseconds
isModified.Settings
Checks if settings has been modified compared to whats on file
getEnvironment.Arguments
Gets an existing environment
listDirectory
Gets the file names in the directory
detachPackage
Detaches a packages by name
draw.density
Draws a density curve
as.character.ProgressBar
Gets a string description of the progress bar
devSetLabel
Sets the label of a device
evalCapture
Evaluates an expression and captures the code and/or the output
callHooks.function
Call hook functions
intervalsToSeq.matrix
Generates a vector of indices from a matrix of intervals
getLogicals.Arguments
Coerces to a logical vector and validates
getRegularExpression.Arguments
Gets a valid regular expression pattern
devIsOpen
Checks if a device is open or not
isZero
Checks if a value is (close to) zero or not
copyFile
Copies a file safely
increase.ProgressBar
Increases (steps) progress bar
cat.Verbose
Concatenates and prints objects if above threshold
devDone
Closes an open device unless it is a on-screen (interactive) device
findGhostscript.System
Searches for the ghostview binary on the current system
getVerbose.Arguments
Coerces to Verbose object
getLoadedPathname.Settings
Gets the pathname of the settings file loaded
whichVector.logical
Identifies TRUE elements in a logical vector
TextStatusBar
A status bar at the R prompt that can be updated
Settings
Class for applicational settings
callHooks
Call hook functions by hook name
getDoubles.Arguments
Coerces to a double vector and validates
addFinalizerToLast
Modifies .Last() to call 'finalizeSession()
newline.TextStatusBar
Writes a newline
compile.SmartComments
Preprocess a vector of code lines
getHostname.System
Retrieves the computer name of the current host
Java
Static class for Java related methods
getOption.Options
Gets an option
hasUrlProtocol
Checks if one or several pathnames has a URL protocol
copyDirectory
Copies a directory
on.Verbose
Turn on the output
onGarbageCollect
Registers a function to be called when the R garbage collector is (detected to be) running
parse.SmartComments
Parses one single smart comment
createWindowsShortcut
Creates a Microsoft Windows Shortcut (.lnk file)
png2
A PNG device for Bitmap Files via GhostScript
createFileAtomically
Creates a file atomically
intToBin
Converts an integer to a binary/octal/hexadecimal number
createLink
Creates a link to a file or a directory
dataFrame
Allocates a data frame with given column classes
moveInSearchPath
Moves a environment in the search path to another position
isScalar.Assert
Static method asserting thatan object is a single value
lastModified
Gets the time when the file was last modified
touchFile
Updates the timestamp of a file
finalizeSession
Function to call for finalizing the R session
eps
EPS graphics device
devOptions
Gets the default device options
isPackageInstalled
Checks if a package is installed or not
openBrowser.System
Opens an HTML document using the OS default HTML browser
newline.Verbose
Writes one or several empty lines
getBuiltinDatetime.GString
Gets the current date and time
inAnyInterval.numeric
Checks if a set of values are inside one or more intervals
seqToHumanReadable
Gets a short human readable string representation of an vector of indices
names.Options
Gets the full pathname of all (non-list) options
extract.array
Extract a subset of an array, matrix or a vector with unknown dimensions
mkdirs
Creates a directory including any necessary but nonexistent parent directories
readUTF.Java
Reads a Java (UTF-8) formatted string from a connection
header.Verbose
Writes a header
getCharacters.Arguments
Coerces to a character vector and validates
findGraphicsDevice.System
Searches for a working PNG device
setLabel.TextStatusBar
Sets the value of a label
getBarString.ProgressBar
Gets the progress bar string to be displayed
getReadablePathnames.Arguments
Gets a readable pathname
writeRaw.MultiVerbose
Writes to each of the Verbose objects
isOn.Verbose
Checks if the output is on
toCamelCase
Converts a string of words into a merged camel-cased word
isOn.NullVerbose
Checks if the output is on
str.Verbose
Prints the structure of an object if above threshold
popTemporaryFile
Drops a temporary suffix from the temporary pathname
capitalize
Capitalizes/decapitalizes each character string in a vector
popMessage.TextStatusBar
Adds a message above the status bar
toEPS
Methods for creating image files of a specific format
updateLabels.TextStatusBar
Sets the new values of given labels and updates the status bar
patchCode
Patches installed and loaded packages and more
insert
Insert values to a vector at certain positions
loadAnywhere.Settings
Loads settings from file
stext
Writes text in the margin along the sides of a plot
doCall
Executes a function call with option to ignore unused arguments
writeRaw.NullVerbose
All output methods
isSingle
Identifies all entries that exists exactly ones
update.FileProgressBar
Updates file progress bar
getIndices.Arguments
Coerces to a integer vector and validates
isFile
Checks if the file specification is a file
isVisible.Verbose
Checks if a certain verbose level will be shown or not
readTableIndex
Reads a single column from file in table format
getParent
Gets the string of the parent specified by this pathname
readRdHelp
Reads one or more Rd help files in a certain format
readBinFragments
Reads binary data from disjoint sections of a connection or a file
MultiVerbose
A Verbose class ignoring everything
saveObject
Saves an object to a file or a connection
setThreshold.Verbose
Sets verbose threshold
dimNA< -
Sets the dimension of an object with the option to infer one dimension autmatically
readWindowsShortcut
Reads a Microsoft Windows Shortcut (.lnk file)
popBackupFile
Drops a backup suffix from the backup pathname
isAbsolutePath
Checks if this pathname is absolute
isVisible.NullVerbose
Checks if a certain verbose level will be shown or not
Options
The Options class
Sys.setenv
Sys.setenv
mergeIntervals.numeric
Merges intervals
getMessage.TimeoutException
Gets the message of the exception
asLong.Java
Converts a numeric to a Java long
FileProgressBar
A progress bar that sets the size of a file accordingly
less.Verbose
Creates a cloned instance with a higher threshold
equals.Verbose
Checks if this object is equal to another
isOpen.character
Checks if there is an open connection to a file
lapply.MultiVerbose
Applies a function to each of the Verbose objects
print.Verbose
Prints objects if above threshold
update.ProgressBar
Updates progress bar
as.character.Options
Returns a character string version of this object
writeRaw.Verbose
Writes objects if above threshold
setDefaultLevel.Verbose
Sets the current default verbose level
convertComment.VComments
Converts a verbose comment to R code
evalWithTimeout
Evaluate an R expression and interrupts it if it takes too long
hasOption.Options
Checks if an option exists
writeDataFrame.data.frame
Writes a data.frame to tabular text file
getBuiltinDate.GString
Gets the current date
getLabel.TextStatusBar
Gets the current value of a label
getVector.Arguments
Validates a vector
isEof.connection
Checks if the current file position for a connection is at the 'End of File'
isVector.Assert
Static method asserting thatan object is a vector
getBuiltinTime.GString
Gets the current time
writeByte.Java
Writes a byte (8 bits) to a connection in Java format
reset.SmartComments
Resets a SmartComments compiler
isMatrix.Assert
Static method asserting thatan object is a matrix
reset.ProgressBar
Reset progress bar
hpaste
Concatenating vectors into human-readable strings
pushTemporaryFile
Appends a temporary suffix to the pathname
isDirectory
Checks if the file specification is a directory
ruler.Verbose
Writes a ruler
saveAnywhere.Settings
Saves settings to file
bunzip2
Bunzip a file
getRaw.GString
Gets the unprocessed GString
mapToIntervals.numeric
Maps values to intervals
setTicks.ProgressBar
Sets values for which ticks should be visible
subplots
Creates a grid of subplots
resetWarnings
Resets recorded warnings
setMaxValue.ProgressBar
Sets maximum value
setStepLength.ProgressBar
Sets default step length
loadObject
Method to load object from a file or a connection
splitByPattern
Splits a single character string by pattern
writeInt.Java
Writes a integer (32 bits) to a connection in Java format
flush.TextStatusBar
Flushes the output
swapXY.density
Swaps x and y coordinates of a density object
pushBackupFile
Appends a backup suffix to the pathname
getReadablePathname.Arguments
Gets a readable pathname
setProgress.ProgressBar
Sets current progress
setOption.Options
Sets an option
removeDirectory
Removes a directory
inherits.Assert
Static method asserting that an object inherits from of a certain class
parse.GString
Parses a GString
reset.VComments
Resets a VComments compiler
readTable
Reads a file in table format
unwrap.array
Unwrap an array, matrix or a vector to an array of more dimensions
ProgressBar
Provides text based counting progress bar
promptAndSave.Settings
Prompt user to save modified settings
LComments
The LComments class
setValue.ProgressBar
Sets current value
printf.Verbose
Formats and prints object if above threshold
pushState.Verbose
Pushes the current indentation state of the Verbose object
writeBinFragments
Writes binary data to disjoint sections of a connection or a file
asByte.Java
Converts a numeric to a Java byte
readByte.Java
Reads a Java formatted byte (8 bits) from a connection
timestamp.Verbose
Writes a timestamp
colClasses
Creates a vector of column classes used for tabular reading
update.TextStatusBar
Updates the status bar (visually)
getBuiltinHostname.GString
Gets the hostname of the system running R
toUrl
Converts a pathname into a URL
printf
C-style formatted output
resample
Sample values from a set of elements
GString
Character string with advanced substitutions
countLines
Counts the number of lines in a text file
findSettings.Settings
Searches for the settings file in one or several directories
convertComment.SmartComments
Converts a single smart comment to R code
findSourceTraceback
Finds all 'srcfile' objects generated by source() in all call frames
displayCode
Displays the contents of a text file with line numbers and more
seqToIntervals
Gets all contigous intervals of a vector of indices
R.utils-package
Package R.utils
more.Verbose
Creates a cloned instance with a lower threshold
getBuiltinUsername.GString
Gets the username of the user running R
getVariableValue.GString
Gets a variable value given a name and attributes
devEval
Opens a new device, evaluate (graphing) code, and closes device
setOption
Sets a option in R
reassignInPackage
Re-assigns a new value to an existing object in a loaded package
timestampOn.Verbose
Turns automatic timestamping on and off
devNew
Opens a new device
jpeg2
A JPEG device for Bitmap Files via GhostScript
isReplicated
Identifies all entries with replicated values
warnings.Verbose
Outputs any warnings recorded
loadToEnv
Method to load objects to a new environment
validate.SmartComments
Validates the compiled lines
sourceDirectory
Sources files recursively to either local or global environment
isUrl
Checks if one or several pathnames is URLs
readShort.Java
Reads a Java formatted short (16 bits) from a connection
readInt.Java
Reads a Java formatted int (32 bits) from a connection
sourceTo
Parses and evaluates code from a file or a connection
exit.Verbose
Writes a message and unindents the following output
str.Options
Prints the structure of the options
getBuiltinOs.GString
Gets the operating system of the running machine
validate.VComments
Validates the compiled lines
getInstanceOf.Arguments
Gets an instance of the object that is of a particular class
getLeaves.Options
Gets all (non-list) options in a flat list
gzip
Gzip/Gunzip a file
getWritablePathname.Arguments
Gets a writable pathname
isDone.ProgressBar
Checks if progress bar is completed
isPackageLoaded
Checks if a package is loaded or not
queryRCmdCheck
Gets the on R CMD check if the current R session was launched by it
parseDebian.System
Parses a string, file or connection for Debian formatted parameters
nbrOfOptions.Options
Gets the number of options set
writeShort.Java
Writes a short (16 bits) to a connection in Java format
wrap.array
Reshape an array or a matrix by permuting and/or joining dimensions
onSessionExit
Registers a function to be called when the R session finishes
setLabels.TextStatusBar
Sets new values of given labels
summary.Verbose
Generates a summary of an object if above threshold
writeUTF.Java
Writes a string to a connection in Java format (UTF-8)
Assert
The Assert class
Non-documented objects
Non-documented objects
attachLocally.list
Assigns an objects elements locally
commandArgs
Extract Command Line Arguments
fileAccess
Checks the permission of a file or a directory
filePath
Construct the path to a file from components and expands Windows Shortcuts along the pathname from root to leaf
getIntegers.Arguments
Coerces to a integer vector and validates
getRelativePath
Gets the relative pathname relative to a directory
getNumerics.Arguments
Coerces to a numeric vector and validates
getUsername.System
Retrieves the name of the user running R
print.GString
Prints the processed GString
renameFile
Renames a file safely
setTimestampFormat.Verbose
Sets the default timestamp format