Skip to content
Prev 263159 / 398502 Next

Quick R syntax question

If we assume that your data are in a data frame (which doesn't allow
spaces in column names, hence the periods in the call below):
You can paste together the contents of the two columns with a plus
sign in between using the paste() function. The sep='' option at the
end of the function call specifies that no spaces should be included
between pasted items.
The new object 'output' is a character vector containing the 4 strings
you're after:
[1] "4+3" "5+2" "2+4" "3+3"
On Mon, Jun 20, 2011 at 11:31 AM, Ben Ganzfried <ben.ganzfried at gmail.com> wrote:
--
___________________________
Luke Miller
Postdoctoral Researcher
Marine Science Center
Northeastern University
Nahant, MA
(781) 581-7370 x318