Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decisionpatterns/stitch
Safe Left Joins
https://github.com/decisionpatterns/stitch
Last synced: 9 days ago
JSON representation
Safe Left Joins
- Host: GitHub
- URL: https://github.com/decisionpatterns/stitch
- Owner: decisionpatterns
- License: gpl-3.0
- Created: 2020-08-31T23:30:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-04T18:18:57.000Z (over 4 years ago)
- Last Synced: 2024-08-13T07:11:49.672Z (4 months ago)
- Language: R
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- jimsghstars - decisionpatterns/stitch - Safe Left Joins (R)
README
# stitch - Safely Join and Rectangularize Data
[![CRAN status](https://www.r-pkg.org/badges/version/stitch)](https://CRAN.R-project.org/package=stitch)
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)The **stitch** package provides convenient and safe LEFT JOINS for
table-like objects. LEFT JOINS are commonly used in data science applications
when combining transaction/fact-based details with
dimensional data.## FEATURES
The function `stitch()` is intended to make this easy and fool-proof. It is a
pipeable function, that works on any table-like object.* Use with any table-like objects (data.frames, data.tables, tibbles)
* Pipeable
* Column Order Preserving
* Use NATURAL JOINS (using matching column names)
* Automatically handling name-collisions by auto prefix collisions with RHS name1. Supports LEFT JOINS using `on`, `key` or a NATURAL JOIN.
2. Preserves column ordering, keeping LHS names on the left.
3. Handles column name collisions by auto-prefixing RHS column names with the
name of the data set.## FUTURE(?)
* Idempotent: Multiple joins of the same data do not result
* Auto Prefix of LHS names## Installation
You can install the released version of stitch from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("stitch")
```## Example
This is a basic example which shows you how to solve a common problem:
``` r
library(stitch)left <- data.table( letters = letters[1:5], numbers=1:5 )
right <- data.table( lets = letters[1:6], numbers=1:6 )left %>% stitch(right, on=c("letters"="lets" ) )
```