Extract or Replace parts of dfts object
extract.Rd
Extract or replace subsets of dfts objects.
Arguments
- x
A dfts object. See
dfts()
.- i, j
Numerics for elements to extract.
- ...
Additional parameters from generic function for extensions.
- value
A suitable replacement value for selection.
Examples
electricity[1:3]
#> Spanish Electricity Spot Prices 2014
#> dimension: 24 x 3
#> fparam (24): 0 0.04347826 0.08695652 0.1304348 0.173913 0.2173913 ...
#> labels (3): 2014-01-01 2014-01-02 2014-01-03
#>
#> Example data
#> [,1] [,2] [,3]
#> [1,] 20.02 5.13 15.30
#> [2,] 10.34 0.00 5.13
#> [3,] 5.35 0.00 0.00
#> [4,] 5.00 0.00 0.00
#> [5,] 0.50 0.00 0.00
#> [6,] 0.00 0.00 0.00
electricity[1:3,]
#> Spanish Electricity Spot Prices 2014
#> dimension: 3 x 365
#> fparam (3): 0 0.04347826 0.08695652
#> labels (365): 2014-01-01 2014-01-02 2014-01-03 2014-01-04 2014-01-05 2014-01-06 ...
#>
#> Example data
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 20.02 5.13 15.30 21.5 5 25.00
#> [2,] 10.34 0.00 5.13 8.5 0 5.13
#> [3,] 5.35 0.00 0.00 2.5 0 2.20
electricity[1:2,1:4]
#> Spanish Electricity Spot Prices 2014
#> dimension: 2 x 4
#> fparam (2): 0 0.04347826
#> labels (4): 2014-01-01 2014-01-02 2014-01-03 2014-01-04
#>
#> Example data
#> [,1] [,2] [,3] [,4]
#> [1,] 20.02 5.13 15.30 21.5
#> [2,] 10.34 0.00 5.13 8.5
electricity[,1:4]
#> Spanish Electricity Spot Prices 2014
#> dimension: 24 x 4
#> fparam (24): 0 0.04347826 0.08695652 0.1304348 0.173913 0.2173913 ...
#> labels (4): 2014-01-01 2014-01-02 2014-01-03 2014-01-04
#>
#> Example data
#> [,1] [,2] [,3] [,4]
#> [1,] 20.02 5.13 15.30 21.5
#> [2,] 10.34 0.00 5.13 8.5
#> [3,] 5.35 0.00 0.00 2.5
#> [4,] 5.00 0.00 0.00 0.0
#> [5,] 0.50 0.00 0.00 0.0
#> [6,] 0.00 0.00 0.00 0.0
tmp <- dfts(matrix(1:9,3,3))
tmp$data
#> [,1] [,2] [,3]
#> [1,] 1 4 7
#> [2,] 2 5 8
#> [3,] 3 6 9
tmp[1,1] <- 10
tmp$data
#> [,1] [,2] [,3]
#> [1,] 10 4 7
#> [2,] 2 5 8
#> [3,] 3 6 9