Is the following what you want?

> DF <- data.frame(a=1:2, b=3:4)
> DF$a-DF$b
[1] -2 -2
> DF[,"a"]-DF[,"b"]
[1] -2 -2

hope this helps. spencer graves

Ulrich Leopold wrote:
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.

Thanks, Ulrich

______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to