Take the 2-minute tour ×  For a function that I am writing, the
output is a dataframe. But how do i assign the values that are
in one of the columns of my dataframe to objects?  For example,
if I have 2 vectors that I cbind into a dataframe
>numbers<-c(33, 44, 55, 66) >names<-c("A", "B", "C", "D")
>MYdataframe<-data.frame(cbind(names, numbers))  I will get
this:      names numbers 1     A      33 2     B      44 3     C
55 4     D      66  But how do I assign the numbers (e.g. 33) to
objects (e.g. A)  share|improve this question What programming
language are you writing in? Please tag the question
accordingly. –  Matt Ball Feb 3 '12 at 1:13  2 Answers 2  It
does not look like a very good idea: your function would be
assigning variables in the global environment, or in its parent
environment, instead of returning something. If you want to
return several values, you can put them in a named list, e.g.,
list(A=3.14, B=2.71), or a vector if they all have the same type
(they do, if you can put them in a data.