Dear R-community,

When doing this:

> test<-data.frame(a=c(1,2,3))
> rbind(test$a, 3)

I expect something like:

> 1
> 2
> 3
> 2

but get:
>     [,1] [,2] [,3]
>[1,]    1    2    3
>[2,]    2    2    2


the same for:

rbind(test[["a"]], 2)
or
rbind(as.vector(test[["a"]]), 2)
or
rbind(t(as.vector(test[["a"]])), 2)

Why is that and how do I extract the "values" from a dataframe to get the
desired result?

Thank you
Dom








--
View this message in context: 
http://r.789695.n4.nabble.com/Append-data-to-vector-form-a-column-of-a-dataframe-tp3897205p3897205.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to