Learn R Programming

antaresRead (version 2.7.0)

subset.antaresDataList: Subset an antaresDataList

Description

Subset method for antaresDataList.

Usage

# S3 method for antaresDataList
subset(x, y = NULL, areas = NULL, timeIds = NULL, mcYears = NULL, ...)

Value

A filtered antaresDataList.

Arguments

x

Object of class antaresDataList created with readAntares.

y

A table containing at least one of the columns "area", "timeId" or "mcYear". If it is not NULL, then only tuples (area, timeId, mcYear) present in this table are kept.

areas

Vector of area names to keep in the result. If NULL, all areas are kept.

timeIds

Vector of time ids to keep. If NULL, all time ids are kept.

mcYears

Vector of monte-carlo years to keep. If NULL, all time ids are kept.

...

Currently unused.

Examples

Run this code
if (FALSE) {
#keep only the first year
mydata <- readAntares(areas = "all", links = "all", mcYears = "all")
mySubset<-subset(mydata, mcYears = 1)
  
#keep only the first year for areas a and b 
mydata <- readAntares(areas = "all", links = "all", mcYears = "all")
mySubset<-subset(mydata, mcYears = 1, areas=c("a", "b")) 

#' #keep only the first year for areas a and b and timeIds include in 5:16 
mydata <- readAntares(areas = "all", links = "all", mcYears = "all")
mySubset<-subset(mydata, mcYears = 1, areas=c("a", "b"), timeIds=5:16) 
  
}

Run the code above in your browser using DataLab