I'm seeing some inconsistent behavior when re-assigning values in a data
frame. The first assignment turns all of the 0s in my data frame to 2s,
the second fails to do so.
df1 - data.frame(a = c(NA, 0, 3, 4))
df2 - data.frame(a = c(NA, 0, 0, 4))
df1[df1 == 0] - 2 ## Works
df2[df2 == 0] - 2
On Thu, 9 Jun 2005, McGehee, Robert wrote:
I'm seeing some inconsistent behavior when re-assigning values in a data
frame. The first assignment turns all of the 0s in my data frame to 2s,
the second fails to do so.
df1 - data.frame(a = c(NA, 0, 3, 4))
df2 - data.frame(a = c(NA, 0, 0, 4))
On Thu, 9 Jun 2005, Thomas Lumley wrote:
On Thu, 9 Jun 2005, McGehee, Robert wrote:
I'm seeing some inconsistent behavior when re-assigning values in a data
frame. The first assignment turns all of the 0s in my data frame to 2s,
the second fails to do so.
But they differ in several ways, so