select: Fetch columns from a population or population model

Description Usage Arguments Value Examples

View source: R/population.R

Description

Fetch specified columns from a population or population model.

Usage

1
select(x, target = NULL, where = NULL, rowids = NULL)

Arguments

x

an EDP population from population(...) or an EDP population model from popmod(...)

target

a character vector of column names, defaults to names(pm) minus names(where)

where

a list of conditions to select on; list(a = "x", c = 3) means only to return rows where a is "x" and c is 3.

rowids

a list of integer row ids to return. These row ids match the row names returned by select. rowids is exclusive with where.

Value

a data frame with the columns specified in target.

Examples

1
2
3
4
5
6
7
  ## Not run: 
    # similar to SQL "SELECT a, b FROM pm WHERE c = 4;"
    select(pm, c("a", "b"), where = list(c = 4))

    select(pm, c("a", "b"), rowids = c(7, 22))
  
## End(Not run)

edpclient documentation built on May 2, 2019, 2:01 p.m.