MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/R/library/OREdplyr/doc/man/en/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/R/library/OREdplyr/doc/man/en/join.Rd

%
% Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
%
\name{join}
\alias{full_join}
\alias{inner_join}
\alias{join}
\alias{left_join}
\alias{right_join}
\title{Join Two \code{ore.frame} Objects by the Specified Columns}
\usage{
inner_join(x, y, by = NULL)

left_join(x, y, by = NULL)

right_join(x, y, by = NULL)

full_join(x, y, by = NULL)
}
\arguments{
\item{x,y}{The \code{ore.frame} objects to join.}

\item{by}{A character vector of column names to join by.  The default is 
\code{NULL}. The \code{join} function does a natural join, using all columns
with common names across the two tables.

To join by different columns on \code{x} and \code{y}, use a named vector
string. For example, \code{by = c("a" = "b")} will match column \code{a} 
in \code{x} with column \code{b} in \code{y}.}
}
\description{
\code{inner_join} Returns all combination of rows from \code{x} and \code{y}
over matched columns.
\code{left_join} Returns rows from \code{inner_join} plus rows from \code{x}
that do not match with \code{y}. For unmatched rows of \code{x}, NA is returned.
\code{right_join} Returns rows from \code{inner_join} plus rows from \code{y}
that do not match with \code{x}. For unmatched rows of \code{y}, NA is returned.
\code{full_join} Returns the union of rows from \code{left_join} and \code{right_join}.
}
\examples{
MTCARS <- ore.push(mtcars)
M1 <- filter(select(MTCARS, mpg, cyl, carb), carb < 6L)
M2 <- filter(select(MTCARS, cyl, hp, carb), carb > 2L)

names(inner_join(M1, M2))
nrow(inner_join(M1, M2))
nrow(left_join(M1, M2))
nrow(right_join(M1, M2))
nrow(full_join(M1, M2))

names(M2) <- c("cyl", "hp", "carb2")
names(inner_join(M1, M2, by = c("cyl", carb="carb2")))
nrow(inner_join(M1, M2, by = c("cyl", carb="carb2")))
nrow(left_join(M1, M2, by = c("cyl", carb="carb2")))
nrow(right_join(M1, M2, by = c("cyl", carb="carb2")))
nrow(full_join(M1, M2, by = c("cyl", carb="carb2")))
}


OHA YOOOO