Table of Contents

ORE - Snippet

About

ore snippet

Prerequisite

Snippets

Load Data Frame to table

Load Data Frame to table

ore.drop(table = "IRIS_TABLE")
# If IRIS_TABLE doesn't exist, you do not get a message.

# create a database table with the data contained in iris
ore.create(iris, table = "IRIS_TABLE")

List the table

ore.ls()

Copy a table

Create IRIS_TABLE_N that does not contain SPECIES, the nonnumeric column:

IRIS_TABLE_N=IRIS_TABLE[,c("SEPAL_LENGTH", "SEPAL_WIDTH",  "PETAL_LENGTH", "PETAL_WIDTH")]

NULL

The sample null.R is the only sample that does not use iris as data. null.R compares the handling of NULLs in SQL with the handling of NAs in R.

R code

nrow(airquality[airquality$Ozone < 30,])
92

nrow(airquality[airquality$Ozone < 30 & !is.na(airquality$Ozone),])
55

ORE Code

ore.drop(table = "AIRQUALITY")
ore.create(airquality, table = "AIRQUALITY")
nrow(AIRQUALITY[AIRQUALITY$OZONE < 30,])
55

options(ore.na.extract = TRUE)
nrow(AIRQUALITY[AIRQUALITY$OZONE < 30,])
92