Dear Steven,

Well, the values x^(1/5) are complex-valued (not real-valued) when x is negative.

Did you want to plot the absolute value of x^(1/5) instead?

Mark

Mark Daniel Ward, Ph.D.
Associate Professor and Undergraduate Chair
Department of Statistics
Purdue University
150 North University Street
West Lafayette, IN 47907-2067
[email protected]
phone: (765) 496-9563


On 5/17/16 8:44 AM, Steven Stoline wrote:
Dear All:


I am trying to plot the function f(x) = x^(1/5) for x=seq(-2,2,0.01). It
give me only the plot of f(x) for the positive part of x. I checked the
values of f(x), it is NaN for all negative values of x.

*this is my code:*


x<-seq(-2,2,0.01)
y<- (x)^(1/5)
plot(x,y, type="l", lwd=3, xlab = " ", ylab = " ", col="blue")
abline(v=0, col="gray", lty=2, lwd=3)
abline(h=0, col="gray", lty=2, lwd=3)



any help will be appreciated.


with many thanks
steve

_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-teaching

Reply via email to