MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/R/library/OREbase/doc/man/zh_CN/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/R/library/OREbase/doc/man/zh_CN/ore.pull.Rd

%
% Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
%
\name{ore.pull}
\alias{ore.pull}
\alias{ore.pull,ANY-method}
\alias{ore.pull,list-method}
\alias{ore.pull,ore.date-method}
\alias{ore.pull,ore.factor-method}
\alias{ore.pull,ore.frame-method}
\alias{ore.pull,ore.integer-method}
\alias{ore.pull,ore.logical-method}
\alias{ore.pull,ore.raw-method}
\alias{ore.pull,ore.tblmatrix-method}
\alias{ore.pull,ore.vecmatrix-method}
\alias{ore.pull,ore.vector-method}
\alias{ore.push}
\alias{ore.push,ANY-method}
\alias{ore.push,data.frame-method}
\alias{ore.push,Date-method}
\alias{ore.push,difftime-method}
\alias{ore.push,matrix-method}
\alias{ore.push,POSIXt-method}
\alias{ore.push,vector-method}
\title{
Oracle R Enterprise 数据交换函数
}
\description{
在 \R 会话和 Oracle R Enterprise 方案之间提取或推送
  数据。
}
\usage{
ore.pull(x, ...)
ore.push(x, ...)
}
\arguments{
  \item{x}{
对于函数 \code{ore.pull}, 为 \code{\linkS4class{ore}} 对象。对于
    函数 \code{ore.push}, 则为 \code{vector}, \code{data.frame},
    \code{matrix} 或 \code{list} 对象。
}
  \item{\dots}{
用于将来扩展。
}
}



\details{
函数 \code{ore.push} 和 \code{ore.pull} 分别将数据放入
  Oracle R Enterprise 方案以及从该方案中检索数据。
  支持的内存中 \R 对象到 \code{\linkS4class{ore}} 对象的映射
  如下所示:
  \itemize{
    \item \code{logical} 映射到 \code{\linkS4class{ore.logical}}
    \item \code{integer} 映射到 \code{\linkS4class{ore.integer}}
    \item \code{numeric} 映射到 \code{\linkS4class{ore.numeric}}
    \item \code{character} 映射到 \code{\linkS4class{ore.character}}
    \item \code{factor} 映射到 \code{\linkS4class{ore.factor}}
    \item \code{raw} 映射到 \code{\linkS4class{ore.raw}}
    \item \code{Date} 映射到 \code{\linkS4class{ore.date}}
    \item \code{POSIXt} 映射到 \code{\linkS4class{ore.datetime}}
    \item \code{difftime} 映射到 \code{\linkS4class{ore.difftime}}
    \item \code{data.frame} 列类型为 \code{logical},
          \code{integer}, \code{numeric}, \code{character},
          \code{factor}, \code{raw} 的列表, \code{Date}, \code{POSIXct}, 
          \code{difftime} 映射到具有
          相应类型列的 \code{\linkS4class{ore.frame}} 
  }
  除了以上映射之外, 对于函数 \code{ore.push}, 如果
  输入为 \code{list} 对象, 则 \code{ore.push} 将递归应用到
  各个元素。同时, 先对列表元素进行串行化,
  然后再将其保存到数据库。\code{envAsEmptyenv} 中的参数 \code{\dots}
  是一个逻辑值, 指示在串行化期间是否应将
  要保存的列表元素对象中的引用环境替换为
  空环境。如果为 \code{TRUE}, 则引用环境
  将被替换为其父级为 \code{.GlobalEnv} 的
  空环境, 因此, 引用环境
  中的内容不串行化并保存到数据库中。
  在某些情况下, 这会显著减少已保存
  对象的大小。如果为 \code{FALSE}, 引用环境中的内容
  将串行化并保存, 并且可在调用 \code{ore.pull} 时
  反串行化并加载到内存中。默认值
  由全局选项 \code{ore.envAsEmptyenv} 控制。
  对于上表列出的内存中 \R 类型, \code{ore.push}
  函数创建维护向量元素的对象, 或者创建
  原始数据对象的数据集行排序。对于所有其他数据类型,
  未指定 \code{ore.push} 的行为。
  属性 \code{ora.type} 可用于指定将 \R 类型
  \code{character} 和 \code{factor} 映射到 \code{CLOB}, 将 
  \R 类型 \code{raw} 映射到 \code{BLOB}。对于这两种情况, 
  \code{ora.type} 分别获取字符串值 \code{"clob"} 和 \code{"blob"}。
}

\value{
函数 \code{ore.pull} 将返回一个包含相应内存中数据的
  内存中 \R 对象。
  函数 \code{ore.push} 将返回一个相应类型的
  \code{\linkS4class{ore}} 对象。
}
\references{
  \href{http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/documentation/index.html}{Oracle R Enterprise}
}
\author{
  Oracle \email{oracle-r-enterprise@oracle.com}
}
\seealso{
  \code{\link{ore.ls}},
  \code{\linkS4class{ore.frame}},
  \code{\linkS4class{ore.matrix}},
  \code{\linkS4class{ore.vector}}
  \code{\link{ore.options}}  
}
\examples{
vec <- 1:10
oreVec <- ore.push(vec)
class(oreVec)
vec2 <- ore.pull(oreVec)
class(vec2)
oreVec3 <- ore.push(oreVec)
class(oreVec3)
vec
oreVec
vec2
oreVec3

IRIS <- ore.push(iris)
class(IRIS)
new.iris <- ore.pull(IRIS)
class(new.iris)
head(IRIS)
head(new.iris)

vraw <- raw(2000L)
oreRaw <- ore.push(vraw)
class(oreRaw)
new.vraw <- ore.pull(oreRaw)
class(new.vraw)
length(new.vraw)

vbraw <- raw(3000L)
attr(vbraw, "ora.type") <- "blob"
oreBRaw <- ore.push(vbraw)
class(oreBRaw)
new.vbraw <- ore.pull(oreBRaw)
class(new.vbraw)
length(new.vbraw)

attr(iris$Species, "ora.type") <- "clob"
iris$Species.raw <- lapply(iris$Species, 
                           function(x) charToRaw(as.character(x)))
attr(iris$Species.raw, "ora.type") <- "blob"
IRIS2 <- ore.push(iris)
class(IRIS2)
new.iris2 <- ore.pull(IRIS2)
class(new.iris2)
}
\keyword{data}
\keyword{database}
\keyword{ORE}

OHA YOOOO