extract | R Documentation |
Extracts from a zoo object all the values belonging to a given month, year or weather season.
extract(x, ...)
## Default S3 method:
extract(x, trgt, ...)
## S3 method for class 'zoo'
extract(x, trgt, ...)
x |
zoo object |
trgt |
numeric or character indicating the elements to extract from |
... |
further arguments passed to or from other methods |
a zoo object with the extracted values.
Mauricio Zambrano-Bigiarini, mzb.devel@gmail
time2season
, seasonalfunction
, daily2annual
, daily2monthly
### Loading temperature data ##
data(SanMartinoPPts)
x <- SanMartinoPPts
## Extracting all the values belonging to February (FEB=2)
extract(x, trgt=2)
## Extracting all the values belonging to February (FEB=2) and April (APR=4)
extract(x, trgt=c(2,4))
## Extracting all the values belonging to the year 1970
extract(x, trgt=1970)
## Extracting all the values belonging to the years 1970 and 1972
extract(x, trgt=c(1970,1972))
## Extracting all the values belonging to the autumn
extract(x, trgt="SON")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.