[R] subtract 2 columns in a data.frame -- found the problem

Ulrich Leopold uleopold at science.uva.nl
Thu Sep 4 14:41:41 CEST 2003


Dear list,

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)".

Ulrich

Peter Dalgaard BSA wrote:
> Ulrich Leopold <uleopold at science.uva.nl> writes:
> 
> 
>>Dear list,
>>
>>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.
> 
> 
> E.g.,
> 
> 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
NL-1018WV Amsterdam

Phone:	+31 20 525 7456 (7451 Secretary)
Fax:	+31 20 525 7431
Mobile:	+31 64 220 3028
Email:	uleopold at science.uva.nl
URL:	www.science.uva.nl/ibed/research/Research_Fields/fg/stafffg/index.html




More information about the R-help mailing list