Hi,

I have noticed that when you try to set a column to NULL on an xts series
(to remove it), and the column does not exists, the existing column is
renamed:

> > prices = (100:130)/10
> MYSTOCK = xts(prices,
as.POSIXct(strptime(as.Date("2010-01-01")+seq(1:length(prices)),
"%Y-%m-%d")))
> colnames(MYSTOCK) = "Close"
> MYSTOCK
           Close
2010-01-02  10.0
2010-01-03  10.1
2010-01-04  10.2
2010-01-05  10.3
2010-01-06  10.4
2010-01-07  10.5
2010-01-08  10.6
2010-01-09  10.7
2010-01-10  10.8
2010-01-11  10.9
2010-01-12  11.0
2010-01-13  11.1
2010-01-14  11.2
2010-01-15  11.3
2010-01-16  11.4
2010-01-17  11.5
2010-01-18  11.6
2010-01-19  11.7
2010-01-20  11.8
2010-01-21  11.9
2010-01-22  12.0
2010-01-23  12.1
2010-01-24  12.2
2010-01-25  12.3
2010-01-26  12.4
2010-01-27  12.5
2010-01-28  12.6
2010-01-29  12.7
2010-01-30  12.8
2010-01-31  12.9
2010-02-01  13.0
> MYSTOCK$doesnotexist = NULL
> MYSTOCK
           doesnotexist
2010-01-02         10.0
2010-01-03         10.1
2010-01-04         10.2
2010-01-05         10.3
2010-01-06         10.4
2010-01-07         10.5
2010-01-08         10.6
2010-01-09         10.7
2010-01-10         10.8
2010-01-11         10.9
2010-01-12         11.0
2010-01-13         11.1
2010-01-14         11.2
2010-01-15         11.3
2010-01-16         11.4
2010-01-17         11.5
2010-01-18         11.6
2010-01-19         11.7
2010-01-20         11.8
2010-01-21         11.9
2010-01-22         12.0
2010-01-23         12.1
2010-01-24         12.2
2010-01-25         12.3
2010-01-26         12.4
2010-01-27         12.5
2010-01-28         12.6
2010-01-29         12.7
2010-01-30         12.8
2010-01-31         12.9
2010-02-01         13.0
> colnames(MYSTOCK)
[1] "doesnotexist"

This looks wrong to me. Is it?

My versions:

> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32

locale:
[1] LC_COLLATE=Dutch_Netherlands.1252  LC_CTYPE=Dutch_Netherlands.1252
 LC_MONETARY=Dutch_Netherlands.1252 LC_NUMERIC=C
[5] LC_TIME=Dutch_Netherlands.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] timeDate_2110.87 IBrokers_0.2-6   quantmod_0.3-14  TTR_0.20-1
Defaults_1.1-1   xts_0.7-1        zoo_1.6-2

loaded via a namespace (and not attached):
[1] grid_2.10.1    lattice_0.18-3 tools_2.10.1
>

Regards,

-Mark-

	[[alternative HTML version deleted]]

