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.
Asked
Active
Viewed 79 times
1
-
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 Answers
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
-
-
-
@Onyambu this is for a college work and I am supposed to calculate the quantile function of "-2 * log(x)" is there any quantile function in R I may use ? – Ricardo Barbosa Nov 19 '20 at 01:12