<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.1">
</HEAD>
<BODY>
<FONT COLOR="#000000">Hi,</FONT><BR>
<BR>
<FONT COLOR="#000000">I have an xts series and want to update some of the values in the series. This works fine when I use an integer index (or list of integer indices), but it doesn't work if I use other methods like the string-based indexing or a list of yearmons. Is this the expected behavior or am I doing something wrong?</FONT><BR>
<BR>
<FONT COLOR="#000000">Brian</FONT><BR>
<BR>
<BR>
<FONT COLOR="#000000">> dates <- timeBasedSeq('185801/2002')</FONT><BR>
<FONT COLOR="#000000">> series <- xts(rep(F, length(dates)), dates)</FONT><BR>
<BR>
<FONT COLOR="#000000">> series['1858-05::1858-07'] <- T</FONT><BR>
<FONT COLOR="#000000">> head(series)</FONT><BR>
<FONT COLOR="#000000"> [,1]</FONT><BR>
<FONT COLOR="#000000">Jan 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">Feb 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">Mar 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">Apr 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">May 1858 FALSE # Expected to be T</FONT><BR>
<FONT COLOR="#000000">Jun 1858 FALSE # Expected to be T</FONT><BR>
<BR>
<FONT COLOR="#000000">> series[dates.1] <- T</FONT><BR>
<FONT COLOR="#000000">> series[dates.1]</FONT><BR>
<FONT COLOR="#000000"> [,1]</FONT><BR>
<FONT COLOR="#000000">May 1858 FALSE # Expected to be T</FONT><BR>
<FONT COLOR="#000000">Jun 1858 FALSE # Expected to be T</FONT><BR>
<FONT COLOR="#000000">Jul 1858 FALSE # Expected to be T</FONT><BR>
<BR>
<FONT COLOR="#000000">> series[1] <- T</FONT><BR>
<FONT COLOR="#000000">> head(series)</FONT><BR>
<FONT COLOR="#000000"> [,1]</FONT><BR>
<FONT COLOR="#000000">Jan 1858 TRUE # T as expected</FONT><BR>
<FONT COLOR="#000000">Feb 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">Mar 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">Apr 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">May 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">Jun 1858 FALSE</FONT><BR>
<BR>
<FONT COLOR="#000000">> series[c(2,3)] <- T</FONT><BR>
<FONT COLOR="#000000">> head(series)</FONT><BR>
<FONT COLOR="#000000"> [,1]</FONT><BR>
<FONT COLOR="#000000">Jan 1858 TRUE</FONT><BR>
<FONT COLOR="#000000">Feb 1858 TRUE # This worked as expected</FONT><BR>
<FONT COLOR="#000000">Mar 1858 TRUE # This worked as expected</FONT><BR>
<FONT COLOR="#000000">Apr 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">May 1858 FALSE</FONT><BR>
<FONT COLOR="#000000">Jun 1858 FALSE</FONT><BR>
<BR>
<BR>
</BODY>
</HTML>