data.table (version 1.0)

subset.data.table: ~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

subset.data.table(x, subset, select, drop = FALSE, ...)

Arguments

x
~~Describe x here~~
subset
~~Describe subset here~~
select
~~Describe select here~~
drop
~~Describe drop here~~
...
~~Describe ... here~~

Value

  • ~Describe the value returned If it is a LIST, use
  • comp1Description of 'comp1'
  • comp2Description of 'comp2'
  • ...

Warning

....

Details

~~ If necessary, more details than the __description__ above ~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as ~~fun~~, ~~~

Examples

Run this code
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, subset, select, drop = FALSE, ...) 
{
    if (missing(subset)) 
        r <- TRUE
    else {
        e <- substitute(subset)
        r <- eval(e, x, parent.frame())
        if (!is.logical(r)) 
            stop("'subset' must evaluate to logical")
        r <- r & !is.na(r)
    }
    if (missing(select)) 
        vars <- TRUE
    else {
        nl <- as.list(1:ncol(x))
        names(nl) <- names(x)
        vars <- eval(substitute(select), nl, parent.frame())
    }
    x[r, vars, drop = drop]
  }

Run the code above in your browser using DataLab