Learn R Programming

Introduction to common

When working in Base R, there are some situations where you stop and wonder: "Why isn't there a function to do that?" For example:

- Why isn't there a function in Base R to get the path of the current program?
- In Base R, why is there no infix operator for concatenation?
- Why isn't there a function in Base R to add/modify data frame labels?
- Why isn't there a function in Base R to source all the programs in a directory?

The answer to all of the above questions is that there should be. The purpose of the common package is to encapsulate these types of functions, and provide them to R users in a lightweight package. These functions are particularly useful for package developers, who might want to add these capabilities to their package without creating dependencies on tidyverse.

If you have ideas for more common functions, please submit your suggestion to the github issue list.

Installation

The easiest way to install the common package is to run the following command from your R console:

install.packages("common")

Then put the following line at the top of your script:

library(common)

For examples and usage information, please visit the common documentation site here.

Introductory Videos

Here is a video introducing most of the major functions in the common package:

Here is an video elaborating on the source.all() function:

For complete function documentation, visit the reference page here

Getting Help

If you need help, the first place to turn to is the web site here

If you want to look at the code for the common package, visit the github page here.

If you encounter a bug or have a feature request, please submit an issue here.

See Also

The common package is part of the sassy meta-package. The sassy meta-package includes several packages that help make R easier for everyone, especially people with a background in SASĀ®. You can read more about the sassy package here.

Copy Link

Version

Install

install.packages('common')

Monthly Downloads

2,301

Version

1.1.5

License

CC0

Issues

Pull Requests

Stars

Forks

Maintainer

David Bosak

Last Published

February 23rd, 2026

Functions in common (1.1.5)

v

Combine unquoted values
symbol

Gets UTF-8 symbol characters
supsc

Converts a string to UTF-8 superscript
%ne%

Check for inequality of two objects
%p%

An infix operator for paste0()
copy.attributes

Copy attributes between two data frames
labels.data.frame

Get or set labels for a data frame
roundup

Rounds numbers up
common

common: A set of useful functions
find.names

Search for names
Sys.path

Returns the path of the current program
%eq%

Check equality of two objects
file.find

Search for files
%ge%

Perform greater than or equal comparison between two objects
%gt%

Perform greater than comparison between two objects
dir.find

Search for directories
changed

Identify changed values
subsc

Converts a string to UTF-8 subscript
spaces

Creates a string of blank spaces
sort.data.frame

Sorts a data frame
%lt%

Perform less than comparison between two objects
%le%

Perform less than or equal comparison between two objects
source.all

Source all programs in a directory