Learn R Programming

edpclient (version 0.5.1)

select: Fetch columns from a population or population model

Description

Fetch specified columns from a population or population model.

Usage

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

Run this code
# NOT RUN {
  
# }
# 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))
  
# }

Run the code above in your browser using DataLab