Package: R.utils 2.12.3

R.utils: Various Programming Utilities

Utility functions useful when programming and developing R packages.

Authors:Henrik Bengtsson [aut, cre, cph]

R.utils_2.12.3.tar.gz
R.utils_2.12.3.zip(r-4.5)R.utils_2.12.3.zip(r-4.4)R.utils_2.12.3.zip(r-4.3)
R.utils_2.12.3.tgz(r-4.4-any)R.utils_2.12.3.tgz(r-4.3-any)
R.utils_2.12.3.tar.gz(r-4.5-noble)R.utils_2.12.3.tar.gz(r-4.4-noble)
R.utils_2.12.3.tgz(r-4.4-emscripten)R.utils_2.12.3.tgz(r-4.3-emscripten)
R.utils.pdf |R.utils.html
R.utils/json (API)
NEWS

# Install 'R.utils' in R:
install.packages('R.utils', repos = c('https://henrikbengtsson.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/henrikbengtsson/r.utils/issues

On CRAN:

592 exports 61 stars 11.31 score 2 dependencies 703 dependents 4.8k scripts 126.0k downloads

Last updated 10 months agofrom:c80170c7ef (on master). Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKAug 14 2024
R-4.5-winOKAug 14 2024
R-4.5-linuxOKAug 14 2024
R-4.4-winOKAug 14 2024
R-4.4-macOKAug 14 2024
R-4.3-winOKAug 14 2024
R-4.3-macOKAug 14 2024

Exports:.Last.lib[.GenericSummaryaddFinalizerToLastaddFinalizerToLast.defaultArgumentsas.character.binmodeas.character.GStringas.character.Optionsas.character.ProgressBaras.character.Verboseas.double.Verboseas.list.MultiVerboseas.list.Optionsas.logical.VerboseasByteasByte.JavaasIntasInt.JavaasLongasLong.JavaAssertasShortasShort.JavaattachLocally.data.frameattachLocally.environmentattachLocally.listbunzip2bunzip2.defaultbzip2bzip2.defaultc.GenericSummarycallHookscallHooks.defaultcallHooks.functioncallHooks.listcapitalizecapitalize.defaultcapturecapture.VerbosecaptureOutputcatcat.defaultcat.FileListTreecat.NullVerbosecat.Verboseccatcheck.Assertcleanupcleanup.FileProgressBarcmdArgcmdArgscmdArgsCallCmdArgsFunctioncmsgcolClassescolClasses.defaultcommandArgscompile.SmartCommentscompressFilecompressFile.defaultcompressPDFcompressPDF.defaultconvertCommentconvertComment.SmartCommentsconvertComment.VCommentscopyDirectorycopyDirectory.defaultcopyFilecopyFile.defaultcountLinescountLines.defaultcoutcprintcprintfcreateFileAtomicallycreateFileAtomically.defaultcreateLinkcreateLink.defaultcreateWindowsShortcutcreateWindowsShortcut.defaultcshowcstrcurrentTimeMilliscurrentTimeMillis.SystemdataFramedataFrame.defaultdecapitalizedecapitalize.defaultdecompressFiledecompressFile.defaultdetachPackagedetachPackage.defaultdimNA<-dimNA<-.defaultdisplayCodedisplayCode.defaultdoCalldoCall.defaultdownloadFiledownloadFile.characterdrawdraw.densityecgetegetegsubenterenter.NullVerboseenter.Verboseenterfenterf.Verboseenvequals.Optionsequals.VerboseevalCaptureevaluateevaluate.GStringevaluate.NullVerboseevaluate.Verboseexitexit.NullVerboseexit.Verboseextractextract.arrayextract.defaultextract.matrixfile.info2fileAccessfileAccess.defaultfilePathfilePath.defaultFileProgressBarfinalizeSessionfinalizeSession.defaultfindFilesfindFiles.defaultfindGhostscriptfindGhostscript.SystemfindGraphicsDevicefindGraphicsDevice.SystemfindSettingsfindSettings.SettingsfindSourceTracebackfindSourceTraceback.defaultflush.TextStatusBarformat.binmodegcatgcat.defaultgcat.GStringgcDLLsGenericSummarygetAbsolutePathgetAbsolutePath.defaultgetBarStringgetBarString.ProgressBargetBuiltinDategetBuiltinDate.GStringgetBuiltinDatetimegetBuiltinDatetime.GStringgetBuiltinHostnamegetBuiltinHostname.GStringgetBuiltinOsgetBuiltinOs.GStringgetBuiltinPidgetBuiltinPid.GStringgetBuiltinRhomegetBuiltinRhome.GStringgetBuiltinRversiongetBuiltinRversion.GStringgetBuiltinTimegetBuiltinTime.GStringgetBuiltinUsernamegetBuiltinUsername.GStringgetCharactergetCharacter.ArgumentsgetCharactersgetCharacters.ArgumentsgetCommonPrefixgetDirectorygetDirectory.ArgumentsgetDoublegetDouble.ArgumentsgetDoublesgetDoubles.ArgumentsgetEnvironment.ArgumentsgetFilenamegetFilename.ArgumentsgetHostnamegetHostname.SystemgetIndexgetIndex.ArgumentsgetIndicesgetIndices.ArgumentsgetInstanceOfgetInstanceOf.ArgumentsgetIntegergetInteger.ArgumentsgetIntegersgetIntegers.ArgumentsgetLabelgetLabel.TextStatusBargetLeavesgetLeaves.OptionsgetLoadedPathnamegetLoadedPathname.SettingsgetLogicalgetLogical.ArgumentsgetLogicalsgetLogicals.ArgumentsgetMappedDrivesOnWindowsgetMappedDrivesOnWindows.SystemgetMessage.TimeoutExceptiongetNumericgetNumeric.ArgumentsgetNumericsgetNumerics.ArgumentsgetOptiongetOption.defaultgetOption.OptionsgetParentgetParent.defaultgetRawgetRaw.GStringgetReadablePathgetReadablePath.ArgumentsgetReadablePathnamegetReadablePathname.ArgumentsgetReadablePathnamesgetReadablePathnames.ArgumentsgetRegularExpressiongetRegularExpression.ArgumentsgetRelativePathgetRelativePath.defaultgetThresholdgetThreshold.VerbosegetTimestampFormatgetTimestampFormat.VerbosegetUsernamegetUsername.SystemgetVariableValuegetVariableValue.GStringgetVectorgetVector.ArgumentsgetVerbosegetVerbose.ArgumentsgetWritablePathgetWritablePath.ArgumentsgetWritablePathnamegetWritablePathname.ArgumentsgstringGStringgstring.defaultgstring.GStringgunzipgunzip.defaultgzipgzip.defaulthasOptionhasOption.OptionshasUrlProtocolhasUrlProtocol.defaultheaderheader.NullVerboseheader.Verbosehpastehpaste.defaulthsizehsize.numerichsize.object_sizeinAnyIntervalinAnyInterval.numericincreaseincrease.ProgressBarinheritsFrominheritsFrom.Assertinsertinsert.defaultinstallPackagesinstallPackages.defaultintervalsToSeqintervalsToSeq.matrixintToBinintToHexintToOctisAbsolutePathisAbsolutePath.defaultisBzippedisBzipped.defaultisCompressedFileisCompressedFile.defaultisDirectoryisDirectory.defaultisDoneisDone.ProgressBarisEofisEof.connectionisFileisFile.defaultisGzippedisGzipped.defaultisMatrixisMatrix.AssertisModifiedisModified.SettingsisOnisOn.NullVerboseisOn.VerboseisOpenisOpen.characterisOpen.defaultisPackageInstalledisPackageInstalled.defaultisPackageLoadedisPackageLoaded.defaultisReplicatedisScalarisScalar.AssertisSingleisUrlisUrl.defaultisVectorisVector.AssertisVisible.NullVerboseisVisible.VerboseisZeroisZero.defaultJavalastModifiedlastModified.defaultLCommentslessless.VerboselistDirectorylistDirectory.defaultloadAnywhereloadAnywhere.SettingsloadObjectloadObject.defaultloadToEnvloadToEnv.defaultmapDriveOnWindowsmapDriveOnWindows.SystemmapToIntervalsmapToIntervals.numericmcatmergeByCommonTailsmergeIntervalsmergeIntervals.numericmkdirsmkdirs.defaultmoremore.VerbosemoutmoveInSearchPathmoveInSearchPath.defaultmpagermprintmprintfmshowmstrMultiVerbosenames.OptionsnbrOfOptionsnbrOfOptions.Optionsnewlinenewline.NullVerbosenewline.TextStatusBarnewline.VerbosenullconnullfileNullVerboseoffoff.Verboseonon.VerboseonGarbageCollectonGarbageCollect.defaultonSessionExitonSessionExit.defaultopenBrowseropenBrowser.SystemOptionsparseparse.defaultparse.GStringparse.SmartCommentsparseDebianparseDebian.SystemparseRepospasteTreepasteTree.FileListTreepatchCodepatchCode.defaultpopBackupFilepopBackupFile.defaultpopMessagepopMessage.TextStatusBarpopStatepopState.VerbosepopTemporaryFilepopTemporaryFile.defaultprint.CapturedEvaluationprint.CmdArgsFunctionprint.GenericSummaryprint.GStringprint.NullVerboseprint.Verboseprintfprintf.defaultprintf.NullVerboseprintf.VerboseprintWarningsprintWarnings.VerboseProgressBarpromptAndSavepromptAndSave.SettingspushBackupFilepushBackupFile.defaultpushStatepushState.VerbosepushTemporaryFilepushTemporaryFile.defaultqueryRCmdCheckR.utilsreadBinFragmentsreadBinFragments.defaultreadBytereadByte.JavareadIntreadInt.JavareadRdHelpreadRdHelp.defaultreadShortreadShort.JavareadTablereadTable.defaultreadTableIndexreadTableIndex.defaultreadUTFreadUTF.JavareadWindowsShellLinkreadWindowsShellLink.defaultreadWindowsShortcutreadWindowsShortcut.defaultreassignInPackagereassignInPackage.defaultremoveDirectoryremoveDirectory.defaultrenameFilerenameFile.defaultreplicatesresampleresample.defaultresetreset.ProgressBarreset.SmartCommentsreset.VCommentsrulerruler.NullVerboseruler.VerbosesaveAnywheresaveAnywhere.SettingssaveObjectsaveObject.defaultseqToHumanReadableseqToHumanReadable.defaultseqToIntervalsseqToIntervals.defaultsetDefaultLevelsetDefaultLevel.VerbosesetLabelsetLabel.TextStatusBarsetLabelssetLabels.TextStatusBarsetMaxValuesetMaxValue.ProgressBarsetOptionsetOption.defaultsetOption.OptionssetProgresssetProgress.ProgressBarsetStepLengthsetStepLength.ProgressBarsetThresholdsetThreshold.VerbosesetTickssetTicks.ProgressBarsetTimestampFormatsetTimestampFormat.VerboseSettingssetValuesetValue.ProgressBarshell.exec2singlesSmartCommentssourceDirectorysourceDirectory.defaultsourceTosourceTo.defaultsplitByCommonTailssplitByPatternsplitByPattern.defaultstextstext.defaultstr.NullVerbosestr.Optionsstr.VerbosestrayDLLssubplotssubplots.defaultsummary.NullVerbosesummary.VerboseswapXYswapXY.densitySys.readlink2SystemsystemRsystemR.defaulttempvarTextStatusBarTimeoutExceptiontimestamptimestamp.defaulttimestamp.VerbosetimestampOfftimestampOff.VerbosetimestampOntimestampOn.VerbosetmpfiletoAsciiRegExprPatterntoAsciiRegExprPattern.charactertoCamelCasetoCamelCase.defaulttoFileListTreetoFileListTree.charactertouchFiletouchFile.defaulttoUrltoUrl.defaultunmapDriveOnWindowsunmapDriveOnWindows.Systemunwrapunwrap.arrayunwrap.data.frameunwrap.defaultunwrap.matrixupdate.FileProgressBarupdate.ProgressBarupdate.TextStatusBarupdateLabelsupdateLabels.TextStatusBaruseuse.defaultuseReposvalidatevalidate.SmartCommentsvalidate.VCommentsVCommentsVerbosewarningswarnings.defaultwarnings.VerbosewhichVectorwhichVector.logicalwhichVector.matrixwithCapturewithLocalewithOptionswithoutGStringwithReposwithSeedwithSinkwithTimeoutwrapwrap.arraywrap.data.framewrap.matrixwriteBinFragmentswriteBinFragments.defaultwriteBytewriteByte.JavawriteDataFramewriteDataFrame.data.framewriteIntwriteInt.JavawriteRawwriteRaw.MultiVerbosewriteRaw.NullVerbosewriteRaw.VerbosewriteShortwriteShort.JavawriteUTFwriteUTF.Java

Dependencies:R.methodsS3R.oo

Readme and manuals

Help Manual

Help pageTopics
Package R.utilsR.utils-package R.utils
Modifies .Last() to call 'finalizeSession()addFinalizerToLast addFinalizerToLast.default
Static class to validate and process argumentsArguments
The Assert classAssert
Assigns an objects elements locallyattachLocally attachLocally.data.frame attachLocally.environment attachLocally.list
Call hook functions by hook namecallHooks callHooks.default
Call hook functionscallHooks.function callHooks.list
Capitalizes/decapitalizes each character string in a vectorcapitalize capitalize.default decapitalize decapitalize.default
Evaluate an R expression and captures the outputcaptureOutput
Simple access to parsed command-line argumentscmdArg cmdArgs
Creates a vector of column classes used for tabular readingcolClasses colClasses.default
Compressing and decompressing filesbunzip2 bunzip2.default bzip2 bzip2.default compressFile compressFile.default decompressFile decompressFile.default gunzip gunzip.default gzip gzip.default isBzipped isBzipped.default isCompressedFile isCompressedFile.default isGzipped isGzipped.default
Compresses a PDF (into a new PDF)compressPDF compressPDF.default
Copies a directorycopyDirectory copyDirectory.default
Counts the number of lines in a text filecountLines countLines.default
Creates a file atomicallycreateFileAtomically createFileAtomically.default
Creates a link to a file or a directorycreateLink createLink.default
Creates a Microsoft Windows Shortcut (.lnk file)createWindowsShortcut createWindowsShortcut.default
Allocates a data frame with given column classesdataFrame dataFrame.default
Detaches packages by namedetachPackage detachPackage.default
Sets the dimension of an object with the option to infer one dimension automaticallydimNA< - dimNA< -.default dimNA<- dimNA<-.default
Displays the contents of a text file with line numbers and moredisplayCode displayCode.default
Executes a function call with option to ignore unused argumentsdoCall doCall.default
Downloads a filedownloadFile downloadFile.character
Global substitute of expression using regular expressionsegsub
Creates a new environment, evaluates an expression therein, and returns the environmentenv
Extract a subset of an array, matrix or a vector with unknown dimensionsextract.array extract.default extract.matrix
Checks the permission of a file or a directoryfileAccess fileAccess.default
Construct the path to a file from components and expands Windows Shortcuts along the pathname from root to leaffilePath filePath.default
A progress bar that sets the size of a file accordinglyFileProgressBar
Function to call for finalizing the R sessionfinalizeSession finalizeSession.default
Finds all 'srcfile' objects generated by source() in all call framesfindSourceTraceback findSourceTraceback.default
Converts a binary/octal/hexadecimal number into a stringas.character.binmode format.binmode
Parses, evaluates and outputs a GStringgcat gcat.default gcat.GString
Identifies and removes DLLs of packages already unloadedgcDLLs strayDLLs
Gets the absolute pathname stringgetAbsolutePath getAbsolutePath.default
Gets the string of the parent specified by this pathnamegetParent getParent.default
Gets the relative pathname relative to a directorygetRelativePath getRelativePath.default
Parses and evaluates a GString into a regular stringgstring gstring.default gstring.GString
Character string with advanced substitutionsGString
Checks if one or several pathnames has a URL protocolhasUrlProtocol hasUrlProtocol.default
Concatenating vectors into human-readable stringshpaste hpaste.default
Checks if a set of values are inside one or more intervalsinAnyInterval.numeric
Insert values to a vector at certain positionsinsert insert.default
Install R packages by name or URLinstallPackages installPackages.default
Generates a vector of indices from a matrix of intervalsintervalsToSeq.matrix
Converts an integer to a binary/octal/hexadecimal numberintToBin intToHex intToOct
Checks if this pathname is absoluteisAbsolutePath isAbsolutePath.default
Checks if the file specification is a directoryisDirectory isDirectory.default
Checks if the current file position for a connection is at the 'End of File'isEof.connection
Checks if the file specification is a fileisFile isFile.default
Checks if there is an open connection to a fileisOpen.character
Checks if a package is installed or notisPackageInstalled isPackageInstalled.default
Checks if a package is loaded or notisPackageLoaded isPackageLoaded.default
Identifies all entries with replicated valuesisReplicated replicates
Identifies all entries that exists exactly onceisSingle singles
Checks if one or several pathnames is URLsisUrl isUrl.default
Checks if a value is (close to) zero or notisZero isZero.default
Static class for Java related methodsJava
Gets the time when the file was last modifiedlastModified lastModified.default
The LComments classLComments
Gets the file names in the directorylistDirectory listDirectory.default
Method to load object from a file or a connectionloadObject loadObject.default
Maps values to intervalsmapToIntervals.numeric
Merges intervalsmergeIntervals.numeric
Creates a directory including any necessary but nonexistent parent directoriesmkdirs mkdirs.default
Miscellaneous functions for outputting via message()ccat cmsg cout cprint cprintf cshow cstr mcat mout mprint mprintf mshow mstr
A \"pager\" function that outputs to standard errormpager
Gets the pathname or a connection to the NULL device on the current platformnullcon nullfile
A Verbose class ignoring everythingNullVerbose
Registers a function to be called when the R garbage collector is (detected to be) runningonGarbageCollect onGarbageCollect.default
Registers a function to be called when the R session finishesonSessionExit onSessionExit.default
The Options classOptions
Patches installed and loaded packages and morepatchCode patchCode.default
Drops a backup suffix from the backup pathnamepopBackupFile popBackupFile.default
Drops a temporary suffix from the temporary pathnamepopTemporaryFile popTemporaryFile.default
C-style formatted outputprintf printf.default
Provides text based counting progress barProgressBar
Appends a backup suffix to the pathnamepushBackupFile pushBackupFile.default
Appends a temporary suffix to the pathnamepushTemporaryFile pushTemporaryFile.default
Gets the on R CMD check if the current R session was launched by itqueryRCmdCheck
Reads binary data from disjoint sections of a connection or a filereadBinFragments readBinFragments.default
Reads one or more Rd help files in a certain formatreadRdHelp readRdHelp.default
Reads a file in table formatreadTable readTable.default
Reads a single column from file in table formatreadTableIndex readTableIndex.default
Reads a Microsoft Windows Shortcut (.lnk file)readWindowsShortcut readWindowsShortcut.default
Removes a directoryremoveDirectory removeDirectory.default
Sample values from a set of elementsresample resample.default
Saves an object to a file or a connectionsaveObject saveObject.default
Gets a short human readable string representation of an vector of indicesseqToHumanReadable seqToHumanReadable.default
Gets all contiguous intervals of a vector of indicesseqToIntervals seqToIntervals.default
Sets a option in RsetOption setOption.default
Class for applicational settingsSettings
Open a file or URL using Windows File Associationsshell.exec2
Abstract class SmartCommentsSmartComments
Sources files recursively to either local or global environmentsourceDirectory sourceDirectory.default
Parses and evaluates code from a file or a connectionsourceTo sourceTo.default
Splits a single character string by patternsplitByPattern splitByPattern.default
Writes text in the margin along the sides of a plotstext stext.default
Creates a grid of subplotssubplots subplots.default
Static class to query information about the systemSystem
Launches another R process from within RsystemR systemR.default
A status bar at the R prompt that can be updatedTextStatusBar
TimeoutException represents timeout errorsTimeoutException
Updates the timestamp of a filetouchFile touchFile.default
Converts a pathname into a URLtoUrl toUrl.default
Unwrap an array, matrix or a vector to an array of more dimensionsunwrap.array unwrap.data.frame unwrap.default unwrap.matrix
Sets package repositoriesparseRepos useRepos
The VComments classVComments
Class to writing verbose messages to a connection or fileVerbose
Evaluates an expression and captures the code and/or the outputevalCapture withCapture
Evaluate an R expression with locale set temporarilywithLocale
Evaluate an R expression with options set temporarilywithOptions
Evaluate an R expression with repositories set temporarilywithRepos
Evaluate an R expression with a temporarily set random setwithSeed
Evaluate an R expression while temporarily diverting outputwithSink
Evaluate an R expression and interrupts it if it takes too longwithTimeout
Reshape an array or a matrix by permuting and/or joining dimensionswrap.array wrap.data.frame wrap.matrix
Writes binary data to disjoint sections of a connection or a filewriteBinFragments writeBinFragments.default
Writes a data.frame to tabular text filewriteDataFrame writeDataFrame.data.frame