Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个变量TEMPD,并且ENERGY
TEMPD
ENERGY
我想创建两个新变量TEMP2并TEMP3执行以下操作:
TEMP2
TEMP3
tempd2 = tempd^2; tempd3 = tempd^3;
有任何想法吗?
您在这里拥有的将起作用,但在 R 中您使用<-而不是=.
<-
=
temp <- 2 energy <- 16 temp2 <- temp^2 energy2 <- energy^2
检查结果:
> temp2 [1] 4 > energy2 [1] 256