[RkWard-devel] Good way to delete a row from a data.frame?

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Sep 2 11:49:31 UTC 2004


> You could try:
> my.data <- my.data[-20]

Neat. I did not know about this possibility. Unfortunately, it still removes 
the attributes (at least for me):

my.data <- data.frame (a=c (1:10), b=c (11:20))
attr (my.data$a, "test") <- "attribute exists"
attr (my.data$a, "test")  # "attribute exists"

my.data <- my.data[-10,]
attr (my.data$a, "test") # NULL

Does the attribute "survive" for you?

Thomas




More information about the Rkward-devel mailing list