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