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.32.4)
Various programming utilities
Description
This package provides utility methods useful when programming 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.32.4
License
LGPL (>= 2.1)
Maintainer
Henrik Bengtsson
Last Published
May 15th, 2014
Functions in R.utils (1.32.4)
Search functions
cmdArgs
Simple access to parsed command-line arguments
arrayIndex
Converts vector indices to array indices
R.utils-package
Package R.utils
NullVerbose
A Verbose class ignoring everything
removeDirectory
Removes a directory
Arguments$getCharacters
Coerces to a character vector and validates
SmartComments
Abstract class SmartComments
Arguments$getNumerics
Coerces to a numeric vector and validates
extract.array
Extract a subset of an array, matrix or a vector with unknown dimensions
FileProgressBar
A progress bar that sets the size of a file accordingly
addFinalizerToLast
Modifies .Last() to call 'finalizeSession()
getRelativePath
Gets the relative pathname relative to a directory
fileAccess
Checks the permission of a file or a directory
createLink
Creates a link to a file or a directory
VComments
The VComments class
as.double.Verbose
Gets a numeric value of this object
Arguments$getWritablePathname
Gets a writable pathname
loadAnywhere.Settings
Loads settings from file
getBarString.ProgressBar
Gets the progress bar string to be displayed
getAbsolutePath
Gets the absolute pathname string
capitalize
Capitalizes/decapitalizes each character string in a vector
Java$writeShort
Writes a short (16 bits) to a connection in Java format
callHooks
Call hook functions by hook name
MultiVerbose
A Verbose class ignoring everything
Assert$isVector
Static method asserting thatan object is a vector
GString$getBuiltinOs
Gets the operating system of the running machine
convertComment.VComments
Converts a verbose comment to R code
as.character.Verbose
Returns a character string version of this object
withRepos
Evaluate an R expression with repositories set temporarily
as.character.Options
Returns a character string version of this object
Java$asLong
Converts a numeric to a Java long
Arguments$getReadablePathname
Gets a readable pathname
listDirectory
Gets the file names in the directory
cat.Verbose
Concatenates and prints objects if above threshold
Sys.readlink2
Read File Symbolic Links (also on Windows)
Options
The Options class
captureOutput
Evaluate an R expression and captures the output
Java$asByte
Converts a numeric to a Java byte
flush.TextStatusBar
Flushes the output
GString$getBuiltinTime
Gets the current time
names.Options
Gets the full pathname of all (non-list) options
Java
Static class for Java related methods
as.character.ProgressBar
Gets a string description of the progress bar
isModified.Settings
Checks if settings has been modified compared to whats on file
Java$asInt
Converts an numeric to a Java integer
mergeIntervals.numeric
Merges intervals
getLabel.TextStatusBar
Gets the current value of a label
colClasses
Creates a vector of column classes used for tabular reading
Arguments$getInstanceOf
Gets an instance of the object that is of a particular class
LComments
The LComments class
gcat
Parses, evaluates and outputs a GString
getTimestampFormat.Verbose
Gets the default timestamp format
finalizeSession
Function to call for finalizing the R session
parse.GString
Parses a GString
copyFile
Copies a file atomically
Verbose
Class to writing verbose messages to a connection or file
whichVector.logical
Identifies TRUE elements in a logical vector
bunzip2
Bunzip a file
copyDirectory
Copies a directory
TimeoutException
TimeoutException represents timeout errors
PERCENT< -PERCENT
Assignment operator for delayed assignments
nbrOfOptions.Options
Gets the number of options set
as.logical.Verbose
Gets a logical value of this object
header.Verbose
Writes a header
more.Verbose
Creates a cloned instance with a lower threshold
GString$getBuiltinRversion
Gets the current R version
compile.SmartComments
Preprocess a vector of code lines
ProgressBar
Provides text based counting progress bar
GString
Character string with advanced substitutions
convertComment.SmartComments
Converts a single smart comment to R code
as.character.binmode
Converts a binary/octal/hexadecimal number into a string
loadObject
Method to load object from a file or a connection
attachLocally.list
Assigns an objects elements locally
capture.Verbose
Captures output of a function
as.list.Options
Gets a list representation of the options
GString$getBuiltinUsername
Gets the username of the user running R
reassignInPackage
Re-assigns a new value to an existing object in a loaded package
createFileAtomically
Creates a file atomically
GString$getBuiltinDate
Gets the current date
System$findGhostscript
Searches for a Ghostview executable on the current system
egsub
Global substitute of expression using regular expressions
commandArgs
Extract command-line arguments
isDone.ProgressBar
Checks if progress bar is completed
Assert$isMatrix
Static method asserting thatan object is a matrix
TextStatusBar
A status bar at the R prompt that can be updated
getLoadedPathname.Settings
Gets the pathname of the settings file loaded
saveAnywhere.Settings
Saves settings to file
displayCode
Displays the contents of a text file with line numbers and more
System$openBrowser
Opens an HTML document using the OS default HTML browser
getRaw.GString
Gets the unprocessed GString
Arguments$getVector
Validates a vector
patchCode
Patches installed and loaded packages and more
isUrl
Checks if one or several pathnames is URLs
Settings$findSettings
Searches for the settings file in one or several directories
inAnyInterval.numeric
Checks if a set of values are inside one or more intervals
printf.Verbose
Formats and prints object if above threshold
setLabel.TextStatusBar
Sets the value of a label
Assert$isScalar
Static method asserting thatan object is a single value
isVisible.Verbose
Checks if a certain verbose level will be shown or not
readWindowsShortcut
Reads a Microsoft Windows Shortcut (.lnk file)
GString$getBuiltinHostname
Gets the hostname of the system running R
equals.Verbose
Checks if this object is equal to another
less.Verbose
Creates a cloned instance with a higher threshold
draw.density
Draws a density curve
print.Verbose
Prints objects if above threshold
System$currentTimeMillis
Get the current time in milliseconds
mkdirs
Creates a directory including any necessary but nonexistent parent directories
str.Verbose
Prints the structure of an object if above threshold
setProgress.ProgressBar
Sets current progress
lastModified
Gets the time when the file was last modified
getOption.Options
Gets an option
setMaxValue.ProgressBar
Sets maximum value
touchFile
Updates the timestamp of a file
setThreshold.Verbose
Sets verbose threshold
writeRaw.Verbose
Writes objects if above threshold
promptAndSave.Settings
Prompt user to save modified settings
setOption
Sets a option in R
printf
C-style formatted output
resetWarnings
Resets recorded warnings
queryRCmdCheck
Gets the on R CMD check if the current R session was launched by it
moveInSearchPath
Moves a environment in the search path to another position
findFiles
Finds one or several files in multiple directories
Java$writeByte
Writes a byte (8 bits) to a connection in Java format
isPackageLoaded
Checks if a package is loaded or not
writeRaw.MultiVerbose
Writes to each of the Verbose objects
getParent
Gets the string of the parent specified by this pathname
detachPackage
Detaches packages by name
loadToEnv
Method to load objects to a new environment
getThreshold.Verbose
Gets current verbose threshold
stext
Writes text in the margin along the sides of a plot
hpaste
Concatenating vectors into human-readable strings
GString$getBuiltinRhome
Gets the path where R is installed
Arguments$getIntegers
Coerces to a integer vector and validates
validate.SmartComments
Validates the compiled lines
validate.VComments
Validates the compiled lines
getMessage.TimeoutException
Gets the message of the exception
as.character.GString
Gets the processed character string
createWindowsShortcut
Creates a Microsoft Windows Shortcut (.lnk file)
Java$asShort
Converts a numeric to a Java short
reset.VComments
Resets a VComments compiler
System$getHostname
Retrieves the computer name of the current host
pushBackupFile
Appends a backup suffix to the pathname
timestampOn.Verbose
Turns automatic timestamping on and off
filePath
Construct the path to a file from components and expands Windows Shortcuts along the pathname from root to leaf
hasOption.Options
Checks if an option exists
isZero
Checks if a value is (close to) zero or not
GString$getBuiltinPid
Gets the process id of the current R session
isReplicated
Identifies all entries with replicated values
doCall
Executes a function call with option to ignore unused arguments
intervalsToSeq.matrix
Generates a vector of indices from a matrix of intervals
setLabels.TextStatusBar
Sets new values of given labels
enter.Verbose
Writes a message and indents the following output
GString$getVariableValue
Gets a variable value given a name and attributes
cmdArgsCall
Calls an R function passing command-line arguments
mapToIntervals.numeric
Maps values to intervals
exit.Verbose
Writes a message and unindents the following output
isPackageInstalled
Checks if a package is installed or not
dataFrame
Allocates a data frame with given column classes
Arguments$getEnvironment
Gets an existing environment
onSessionExit
Registers a function to be called when the R session finishes
on.Verbose
Turn on the output
Assert$inherits
Static method asserting that an object inherits from of a certain class
popTemporaryFile
Drops a temporary suffix from the temporary pathname
use
Attaches or loads packages
sourceDirectory
Sources files recursively to either local or global environment
setValue.ProgressBar
Sets current value
evaluate.Verbose
Evaluates a function and prints its results if above threshold
intToBin
Converts an integer to a binary/octal/hexadecimal number
popMessage.TextStatusBar
Adds a message above the status bar
withCapture
Evaluates an expression and captures the code and/or the output
useRepos
Sets package repositories
pushState.Verbose
Pushes the current indentation state of the Verbose object
GString$getBuiltinDatetime
Gets the current date and time
Java$readUTF
Reads a Java (UTF-8) formatted string from a connection
warnings.Verbose
Outputs any warnings recorded
withTimeout
Evaluate an R expression and interrupts it if it takes too long
withOptions
Evaluate an R expression with options set temporarily
isOn.NullVerbose
Checks if the output is on
readBinFragments
Reads binary data from disjoint sections of a connection or a file
newline.TextStatusBar
Writes a newline
swapXY.density
Swaps x and y coordinates of a density object
summary.Verbose
Generates a summary of an object if above threshold
Arguments$getVerbose
Coerces to Verbose object
reset.ProgressBar
Reset progress bar
installPackages
Install R packages by name or URL
saveObject
Saves an object to a file or a connection
Arguments$getRegularExpression
Gets a valid regular expression pattern
toCamelCase
Converts a string of words into a merged camel-cased word
isEof.connection
Checks if the current file position for a connection is at the 'End of File'
isOpen.character
Checks if there is an open connection to a file
ruler.Verbose
Writes a ruler
wrap.array
Reshape an array or a matrix by permuting and/or joining dimensions
subplots
Creates a grid of subplots
isDirectory
Checks if the file specification is a directory
increase.ProgressBar
Increases (steps) progress bar
readWindowsShellLink
Reads a Microsoft Windows Shortcut (.lnk file)
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
System$parseDebian
Parses a string, file or connection for Debian formatted parameters
systemR
Launches another R process from within R
Java$writeInt
Writes a integer (32 bits) to a connection in Java format
setTimestampFormat.Verbose
Sets the default timestamp format
gzip
Gzip/Gunzip a file
isAbsolutePath
Checks if this pathname is absolute
pushTemporaryFile
Appends a temporary suffix to the pathname
tempvar
Gets a unique non-existing temporary variable name
updateLabels.TextStatusBar
Sets the new values of given labels and updates the status bar
sourceTo
Parses and evaluates code from a file or a connection
writeBinFragments
Writes binary data to disjoint sections of a connection or a file
writeDataFrame.data.frame
Writes a data.frame to tabular text file
readTable
Reads a file in table format
readTableIndex
Reads a single column from file in table format
update.TextStatusBar
Updates the status bar (visually)
str.Options
Prints the structure of the options
timestamp.Verbose
Writes a timestamp
off.Verbose
Turn off the output
newline.Verbose
Writes one or several empty lines
setOption.Options
Sets an option
reset.SmartComments
Resets a SmartComments compiler
update.ProgressBar
Updates progress bar
setTicks.ProgressBar
Sets values for which ticks should be visible
onGarbageCollect
Registers a function to be called when the R garbage collector is (detected to be) running
print.GString
Prints the processed GString
Java$writeUTF
Writes a string to a connection in Java format (UTF-8)
unwrap.array
Unwrap an array, matrix or a vector to an array of more dimensions
Assert
The Assert class
Settings
Class for applicational settings
Non-documented objects
Non-documented objects
Assert$check
Static method asserting that a generic condition is true
cleanup.FileProgressBar
Removes the progress file for a file progress bar
callHooks.function
Call hook functions
eget
Gets a variable by name
equals.Options
Checks if this object is equal to another Options object
findSourceTraceback
Finds all 'srcfile' objects generated by source() in all call frames
Arguments$getIndices
Coerces to a integer vector and validates
Arguments$getReadablePathnames
Gets a readable pathname
getLeaves.Options
Gets all (non-list) options in a flat list
isOn.Verbose
Checks if the output is on
seqToIntervals
Gets all contigous intervals of a vector of indices
setStepLength.ProgressBar
Sets default step length
resample
Sample values from a set of elements
writeRaw.NullVerbose
All output methods
System
Static class to query information about the system
as.list.MultiVerbose
Gets a list of Verbose objects
countLines
Counts the number of lines in a text file
dimNA< -
Sets the dimension of an object with the option to infer one dimension autmatically
Arguments$getDoubles
Coerces to a double vector and validates
Arguments$getFilename
Gets and validates a filename
System$getUsername
Retrieves the name of the user running R
insert
Insert values to a vector at certain positions
popBackupFile
Drops a backup suffix from the backup pathname
parse.SmartComments
Parses one single smart comment
Java$readByte
Reads a Java formatted byte (8 bits) from a connection
Java$readInt
Reads a Java formatted int (32 bits) from a connection
update.FileProgressBar
Updates file progress bar
isFile
Checks if the file specification is a file
hasUrlProtocol
Checks if one or several pathnames has a URL protocol
Arguments$getLogicals
Coerces to a logical vector and validates
isSingle
Identifies all entries that exists exactly ones
renameFile
Renames a file (or a directory) atomically/safely
seqToHumanReadable
Gets a short human readable string representation of an vector of indices
setDefaultLevel.Verbose
Sets the current default verbose level
toUrl
Converts a pathname into a URL
splitByPattern
Splits a single character string by pattern
Java$readShort
Reads a Java formatted short (16 bits) from a connection
Arguments
Static class to validate and process arguments
downloadFile.character
Downloads a file
evaluate.GString
Parses and evaluates a GString
System$findGraphicsDevice
Searches for a working PNG device
readRdHelp
Reads one or more Rd help files in a certain format
file.info2
Extract File Information (acknowledging symbolic file links also on Windows)