1

How can I represent this function: y=-2*log(x) in a plot in R ? I am new to this programming language, any help will help. Thanks in advance.

  • You can use [curve](https://www.rdocumentation.org/packages/graphics/versions/3.6.2/topics/curve) to draw a function plot over an interval. – tomc Nov 19 '20 at 00:44
  • There is the `quantile` function. Look into it – Onyambu Nov 19 '20 at 01:25

1 Answers1

1

You may try this.

y <- function(x) {-2*log(x)}
plot(y, 0, 1, ylab="y", xlab="x", lwd=2)
Akram
  • 355
  • 1
  • 10