[R] subtract 2 columns in a data.frame -- found the problem
uleopold at science.uva.nl
Thu Sep 4 14:41:41 CEST 2003
sorry for having bothering you. I found the problem. It was the a stupid
error made by me. R could not recognise the variable as it is of course case
sensitive for names. So I specified the wrong variable name and R did
complain about it with "numeric(0)".
Peter Dalgaard BSA wrote:
> Ulrich Leopold <uleopold at science.uva.nl> writes:
>>could someone point me to the right command to subtract 2 columns in a
>>data.frame. Might be a bit embarrassing question. But I cannot figure
>>out how to do this simple command in R.
> mydata$difference <- mydata$x - mydata$y
Ulrich Leopold MSc.
Department of Physical Geography
Institute for Biodiversity and Ecosystem Dynamics
Faculty of Science
University of Amsterdam
Nieuwe Achtergracht 166
Phone: +31 20 525 7456 (7451 Secretary)
Fax: +31 20 525 7431
Mobile: +31 64 220 3028
Email: uleopold at science.uva.nl
More information about the R-help