Re: [R] about vector to the power of a decimal

2011-05-12 Thread Phil Spector
Please take a look at FAQ 7.33 (http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-powers-of-negative-numbers-wrong_003f) Basically, what you're really calculating is -(2^2.1) [1] -4.287094 You can't raise a negative number to a fractional power, unless you specify it as a complex number

[R] about vector to the power of a decimal

2011-05-12 Thread 张静思
Hi why I can't do this? m<-c(1,-2,3) m^2.1 with a negative number in it ,but I can do this to a single negative number like -2^2.1~ Thank you ~ JIngsi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.eth