Learn R Programming

scidb (version 1.1-2)

sort-methods: Methods for Function sort in Package scidb

Description

Aggregate a SciDB array object grouped by a subset of its dimensions and/or attributes.

Usage

## S3 method for class 'scidb':
sort(x, decreasing=FALSE, attributes, eval)
## S3 method for class 'scidbdf':
sort(x, decreasing=FALSE, attributes, eval)

Arguments

x
A scidb or scidbdf object.
decreasing
A logical value: TRUE means sort in decreasing order.
attributes
(Required) A character vector of attribute names from array x to sort on
eval
(Optional) If true, execute the query and store the result array. Otherwise defer evaluation.

Value

  • A scidb or scidbdf reference object.

Details

Create a new array reference object that represents the sorted version of array x. The output array reference has the same shape and number of attributes as x but the specified attributes appear in sorted order.

Examples

Run this code
# Create a copy of the iris data frame in a 1-d SciDB array named "iris."
# Note that SciDB attribute names will be changed to conform to SciDB
# naming convention.
x <- as.scidb(iris,name="iris")

# Sort x by Petal_Width and Petal_Length:
a <- sort(x, attributes=c("Petal_Width","Petal_Length"))

Run the code above in your browser using DataLab