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.2.2)
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
224,871
Version
1.2.2
License
LGPL (>= 2.1)
Maintainer
Henrik Bengtsson
Last Published
October 18th, 2009
Functions in R.utils (1.2.2)
Search functions
SmartComments
Abstract class SmartComments
as.character.binmode
Converts a binary/octal/hexadecimal number into a string
NullVerbose
A Verbose class ignoring everything
VComments
The VComments class
arrayIndex
Converts vector indices to array indices
asInt.Java
Converts an numeric to a Java integer
check.Assert
Static method asserting that a generic condition is true
convertComment.VComments
Converts a verbose comment to R code
convertComment.SmartComments
Converts a single smart comment to R code
detachPackage
Detaches a packages by name
TextStatusBar
A status bar at the R prompt that can be updated
as.character.Verbose
Returns a character string version of this object
ProgressBar
Provides text based counting progress bar
eps
EPS graphics device
getBuiltinHostname.GString
Gets the hostname of the system running R
getBuiltinDatetime.GString
Gets the current date and time
asLong.Java
Converts a numeric to a Java long
getCharacters.Arguments
Coerces to a character vector and validates
as.character.ProgressBar
Gets a string description of the progress bar
getLeaves.Options
Gets all (non-list) options in a flat list
print.Verbose
Prints objects if above threshold
attachLocally.list
Assigns an objects elements locally
cat.Verbose
Concatenates and prints objects if above threshold
callHooks.function
Call hook functions
setLabels.TextStatusBar
Sets new values of given labels
createWindowsShortcut
Creates a Microsoft Windows Shortcut (.lnk file)
mapToIntervals.numeric
Maps values to intervals
compile.SmartComments
Preprocess a vector of code lines
copyDirectory
Copies a directory
capture.Verbose
Captures output of a function
getAbsolutePath
Gets the absolute pathname string
devSetLabel
Sets the label of a device
getLogicals.Arguments
Coerces to a logical vector and validates
getLabel.TextStatusBar
Gets the current value of a label
moveInSearchPath
Moves a environment in the search path to another position
newline.TextStatusBar
Writes a newline
getVariableValue.GString
Gets a variable value given a name and attributes
System
Static class to query information about the system
getLoadedPathname.Settings
Gets the pathname of the settings file loaded
Non-documented objects
Non-documented objects
getBarString.ProgressBar
Gets the progress bar string to be displayed
getReadablePathname.Arguments
Gets a readable pathname
openBrowser.System
Opens an HTML document using the OS default HTML browser
findGraphicsDevice.System
Searches for a working PNG device
R.utils-package
Package R.utils
getIntegers.Arguments
Coerces to a integer vector and validates
getReadablePathnames.Arguments
Gets a readable pathname
readBinFragments
Reads binary data from disjoint sections of a connection or a file
getIndices.Arguments
Coerces to a integer vector and validates
asByte.Java
Converts a numeric to a Java byte
as.list.Options
Gets a list representation of the options
getDoubles.Arguments
Coerces to a double vector and validates
devIsOpen
Checks if a device is open or not
getRegularExpression.Arguments
Gets a valid regular expression pattern
getUsername.System
Retrieves the name of the user running R
header.Verbose
Writes a header
readShort.Java
Reads a Java formatted short (16 bits) from a connection
jpeg2
A JPEG device for Bitmap Files via GhostScript
as.character.GString
Gets the processed character string
isModified.Settings
Checks if settings has been modified compared to whats on file
getRaw.GString
Gets the unprocessed GString
getBuiltinRversion.GString
Gets the current R version
equals.Verbose
Checks if this object is equal to another
writeShort.Java
Writes a short (16 bits) to a connection in Java format
parse.SmartComments
Parses one single smart comment
Assert
The Assert class
getBuiltinUsername.GString
Gets the username of the user running R
capitalize
Capitalizes/decapitalizes each character string in a vector
hasOption.Options
Checks if an option exists
getTimestampFormat.Verbose
Gets the default timestamp format
validate.VComments
Validates the compiled lines
isPackageInstalled
Checks if a package is installed or not
increase.ProgressBar
Increases (steps) progress bar
loadObject
Method to load object from a file or a connection
getVerbose.Arguments
Coerces to Verbose object
currentTimeMillis.System
Get the current time in milliseconds
getNumerics.Arguments
Coerces to a numeric vector and validates
getVector.Arguments
Validates a vector
setValue.ProgressBar
Sets current value
getBuiltinOs.GString
Gets the operating system of the running machine
isScalar.Assert
Static method asserting thatan object is a single value
lastModified
Gets the time when the file was last modified
readUTF.Java
Reads a Java (UTF-8) formatted string from a connection
print.GString
Prints the processed GString
isOpen.character
Checks if there is an open connection to a file
isVisible.NullVerbose
Checks if a certain verbose level will be shown or not
getWritablePathname.Arguments
Gets a writable pathname
copyFile
Copies a file safely
Settings
Class for applicational settings
countLines
Counts the number of lines in a text file
inherits.Assert
Static method asserting that an object inherits from of a certain class
isAbsolutePath
Checks if this pathname is absolute
sourceDirectory
Sources files recursively to either local or global environment
Verbose
Class to writing verbose messages to a connection or file
splitByPattern
Splits a single character string by pattern
extract.array
Extract a subset of an array, matrix or a vector with unknown dimensions
isPackageLoaded
Checks if a package is loaded or not
isUrl
Checks if one or several pathnames is URLs
setOption.Options
Sets an option
getRelativePath
Gets the relative pathname relative to a directory
gzip
Gzip/Gunzip a file
timestamp.Verbose
Writes a timestamp
reset.ProgressBar
Reset progress bar
insert
Insert values to a vector at certain positions
loadToEnv
Method to load objects to a new environment
on.Verbose
Turn on the output
isDone.ProgressBar
Checks if progress bar is completed
setDefaultLevel.Verbose
Sets the current default verbose level
readInt.Java
Reads a Java formatted int (32 bits) from a connection
isEof.connection
Checks if the current file position for a connection is at the 'End of File'
popMessage.TextStatusBar
Adds a message above the status bar
removeDirectory
Removes a directory
promptAndSave.Settings
Prompt user to save modified settings
mergeIntervals.numeric
Merges intervals
update.ProgressBar
Updates progress bar
isMatrix.Assert
Static method asserting thatan object is a matrix
setStepLength.ProgressBar
Sets default step length
remove.FileProgressBar
Removes the progress file for a file progress bar
timestampOn.Verbose
Turns automatic timestamping on and off
sourceTo
Parses and evaluates code from a file or a connection
printf.Verbose
Formats and prints object if above threshold
FileProgressBar
A progress bar that sets the size of a file accordingly
lapply.MultiVerbose
Applies a function to each of the Verbose objects
as.double.Verbose
Gets a numeric value of this object
nbrOfOptions.Options
Gets the number of options set
writeBinFragments
Writes binary data to disjoint sections of a connection or a file
intervalsToSeq.matrix
Generates a vector of indices from a matrix of intervals
setMaxValue.ProgressBar
Sets maximum value
saveAnywhere.Settings
Saves settings to file
setTimestampFormat.Verbose
Sets the default timestamp format
update.FileProgressBar
Updates file progress bar
readWindowsShortcut
Reads a Microsoft Windows Shortcut (.lnk file)
setProgress.ProgressBar
Sets current progress
png2
A PNG device for Bitmap Files via GhostScript
resetWarnings
Resets recorded warnings
isOn.Verbose
Checks if the output is on
relibrary
Reloads a package
seqToHumanReadable
Gets a short human readable string representation of an vector of indices
isVector.Assert
Static method asserting thatan object is a vector
seqToIntervals
Gets all contigous intervals of a vector of indices
unwrap.array
Unwrap an array, matrix or a vector to an array of more dimensions
setTicks.ProgressBar
Sets values for which ticks should be visible
names.Options
Gets the full pathname of all (non-list) options
readByte.Java
Reads a Java formatted byte (8 bits) from a connection
toCamelCase
Converts a string of words into a merged camel-cased word
writeInt.Java
Writes a integer (32 bits) to a connection in Java format
update.TextStatusBar
Updates the status bar (visually)
wrap.array
Reshape an array or a matrix by permuting and/or joining dimensions
more.Verbose
Creates a cloned instance with a lower threshold
ruler.Verbose
Writes a ruler
pushState.Verbose
Pushes the current indentation state of the Verbose object
off.Verbose
Turn off the output
updateLabels.TextStatusBar
Sets the new values of given labels and updates the status bar
summary.Verbose
Generates a summary of an object if above threshold
writeRaw.MultiVerbose
Writes to each of the Verbose objects
dataFrame
Allocates a data frame with given column classes
equals.Options
Checks if this object is equal to another Options object
displayCode
Displays the contents of a text file with line numbers and more
dimNA< -
Sets the dimension of an object with the option to infer one dimension autmatically
writeRaw.NullVerbose
All output methods
fileAccess
Checks the permission of a file
getBuiltinTime.GString
Gets the current time
writeUTF.Java
Writes a string to a connection in Java format (UTF-8)
commandArgs
Extract Command Line Arguments
writeRaw.Verbose
Writes objects if above threshold
exit.Verbose
Writes a message and unindents the following output
finalizeSession
Function to call for finalizing the R session
devDone
Closes an on-screen (interactive) device
onSessionExit
Registers a function to be called when the R session finishes
evaluate.Verbose
Evaluates a function and prints its results if above threshold
reset.VComments
Resets a VComments compiler
touchFile
Updates the timestamp of a file
validate.SmartComments
Validates the compiled lines
asShort.Java
Converts a numeric to a Java short
mkdirs
Creates a directory including any necessary but nonexistent parent directories
patchCode
Patches installed and loaded packages and more
warnings.Verbose
Outputs any warnings recorded
parse.GString
Parses a GString
Arguments
Static class to validate and process arguments
MultiVerbose
A Verbose class ignoring everything
as.logical.Verbose
Gets a logical value of this object
colClasses
Creates a vector of column classes used for tabular reading
bunzip2
Bunzip a file
devList
Lists the indices of the open devices named by their labels
findGhostscript.System
Searches for the ghostview binary on the current system
getEnvironment.Arguments
Gets an existing environment
getHostname.System
Retrieves the computer name of the current host
isOn.NullVerbose
Checks if the output is on
setThreshold.Verbose
Sets verbose threshold
Options
The Options class
getBuiltinPid.GString
Gets the process id of the current R session
reset.SmartComments
Resets a SmartComments compiler
str.Options
Prints the structure of the options
newline.Verbose
Writes one or several empty lines
str.Verbose
Prints the structure of an object if above threshold
Java
Static class for Java related methods
devGetLabel
Gets 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
getOption.Options
Gets an option
isDirectory
Checks if the file specification is a directory
listDirectory
Gets the file names in the directory
readTableIndex
Reads a single column from file in table format
isFile
Checks if the file specification is a file
GString
Character string with advanced substitutions
addFinalizerToLast
Modifies .Last() to call 'finalizeSession()
as.character.Options
Returns a character string version of this object
devNew
Opens a new device
flush.TextStatusBar
Flushes the output
getBuiltinRhome.GString
Gets the path where R is installed
getParent
Gets the string of the parent specified by this pathname
isVisible.Verbose
Checks if a certain verbose level will be shown or not
subplots
Creates a grid of subplots
toUrl
Converts a pathname into a URL
whichVector.logical
Identifies TRUE elements in a logical vector
LComments
The LComments class
createLink
Creates a link to a file or a directory
devOff
Closes a device
devSet
Activates a device
doCall
Executes a function call with option to ignore unused arguments
findSettings.Settings
Searches for the settings file in one or several directories
getThreshold.Verbose
Gets current verbose threshold
intToBin
Converts an integer to a binary/octal/hexadecimal number
loadAnywhere.Settings
Loads settings from file
parseDebian.System
Parses a string, file or connection for Debian formatted parameters
readTable
Reads a file in table format
setLabel.TextStatusBar
Sets the value of a label
saveObject
Saves an object to a file or a connection
writeByte.Java
Writes a byte (8 bits) to a connection in Java format
callHooks
Call hook functions by hook name
enter.Verbose
Writes a message and indents the following output
getBuiltinDate.GString
Gets the current date
inAnyInterval.numeric
Checks if a set of values are inside one or more intervals
hasUrlProtocol
Checks if one or several pathnames has a URL protocol
isZero
Checks if a value is (close to) zero or not
less.Verbose
Creates a cloned instance with a higher threshold
reassignInPackage
Re-assigns a new value to an existing object in a loaded package