Q:

create new variables in R

I have two variables TEMPD, and ENERGY
I want to create two new variables TEMP2 and TEMP3 by doing something like:
tempd2 = tempd^2;
tempd3 = tempd^3;

Any ideas? 

A:

What you have here will work, but in R you use <- instead of =. 
temp <- 2
energy <- 16

temp2 <- temp^2
energy2 <- energy^2

Checking the outcomes:
> temp2
 [1] 4
> energy2
 [1] 256

