transaction.convert: Quickly convert data frame to transaction

Description Usage Arguments Value Author(s) Examples

Description

This function helps users to convert data frame to transaction data quickly

Usage

1
transaction.convert(data, type = c("wide", "long"))

Arguments

Data

set - This functions supports 2 kinds of data wide & long

Type

- Two option: "wide" and "long"

Value

Return a transaction data

Author(s)

Anh Hoang Duc (anhhd3@vpbank.com.vn)

Examples

1
2
3
4
df1 <- data.frame(Transaction_ID = c(1,2,1,3,1,2), Products = c(2,3,2,4,4,5))
transaction.convert(df1, type = "long")
df2 <- data.frame(ID = c(1,2,3), Product_1 = c(1,1,0), Product_2 = c(0,1,1), Product_3 = c(0,0,1))
transaction.convert(df2, type = "wide")

anhhd/VPBank1 documentation built on May 10, 2019, 11:47 a.m.