Thanks. Yes, I meant nrow(dataset)+1 (typo...)
Sammy
On Mon, Nov 14, 2011 at 1:29 AM, Petr PIKAL wrote:
> >
> > dataset[ nrow(dataset), ] <- c ("Male", 5, "bad")
> >
> > The above seems to have worked to append a row in place of a rbind().
> This
>
> No. It overwrites your last row. You maybe m
>
> dataset[ nrow(dataset), ] <- c ("Male", 5, "bad")
>
> The above seems to have worked to append a row in place of a rbind().
This
No. It overwrites your last row. You maybe meant
dataset[ nrow(dataset)+1, ] <- c ("Male", 5, "bad")
Regards
Petr
> method does not drop the custom attributes
On Nov 13, 2011, at 11:28 AM, Sammy Zee wrote:
dataset[ nrow(dataset), ] <- c ("Male", 5, "bad")
The above seems to have worked to append a row in place of a
rbind(). This method does not drop the custom attributes from the
column. Do yo see any issue with this method.
Only that it wipes
dataset[ nrow(dataset), ] <- c ("Male", 5, "bad")
The above seems to have worked to append a row in place of a rbind(). This
method does not drop the custom attributes from the column. Do yo see any
issue with this method.
Thanks,
Sammy
On Sat, Nov 12, 2011 at 10:16 PM, David Winsemius wrote:
>
On Nov 12, 2011, at 6:40 PM, Sammy Zee wrote:
Thanks David. Besides rbind(), is there any other way to add a row
to a data frame so that I do not lose the custom attributes.
I have already told you the method that I know of. You don't seem to
have taken my poin that it is not a data.frame
Thanks David. Besides rbind(), is there any other way to add a row to a
data frame so that I do not lose the custom attributes.
Thanks,
Sammy
On Sat, Nov 12, 2011 at 5:17 PM, David Winsemius wrote:
>
> On Nov 12, 2011, at 2:47 PM, Sammy Zee wrote:
>
> When I use rbind() or rbind.data.frame() to
On Nov 12, 2011, at 2:47 PM, Sammy Zee wrote:
When I use rbind() or rbind.data.frame() to add a row to an existing
dataframe, it appears that attributes for the column of type
"factor" are
dropped. See the sample example below to reproduce the problem. Please
suggest How I can fix this.
When I use rbind() or rbind.data.frame() to add a row to an existing
dataframe, it appears that attributes for the column of type "factor" are
dropped. See the sample example below to reproduce the problem. Please
suggest How I can fix this.
Thanks,
Sammy
a=c("Male", "Male", "Female", "Male")
b=c
8 matches
Mail list logo