Bug 16769 - tsp<-(x, NULL) does not remove "mts" class
Summary: tsp<-(x, NULL) does not remove "mts" class
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Misc (show other bugs)
Version: R-devel (trunk)
Hardware: x86_64/x64/amd64 (64-bit) Linux-Ubuntu
: P5 trivial
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2016-03-17 20:39 UTC by Sebastian Meyer
Modified: 2016-03-23 10:41 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Meyer 2016-03-17 20:39:24 UTC
The "tsp<-" help page says:

    Assigning ‘NULL’ which removes the ‘tsp’ attribute _and_ any
    ‘"ts"’ (or ‘"mts"’) class of ‘x’.

I observe:

    z <- ts(cbind(1:5,1:5))
    class(z)
    # [1] "mts"    "ts"     "matrix"
    tsp(z) <- NULL
    class(z)
    # [1] "mts"    "matrix"

Although this behaviour is probably in line with the logical "or" in the documentation, I think the NULL assignment should remove both the "ts" _and_ "mts" classes.

For the record: The "tsp" attribute is removed correctly and, for univariate time series, assigning NULL correctly removes the "ts" class.

-- 
R Under development (unstable) (2016-03-17 r70348)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS
Comment 1 Duncan Murdoch 2016-03-23 10:41:46 UTC
Fixed in R-devel and R-3.3.0-alpha.