Skip to content
Prev 386985 / 398502 Next

How to find when a value is reached given a function?

If I run this:
```
Y = c(10000, 20000, 40000, 80000, 160000, 320000, 640000, 1280000)
X = 0:7
plot(Y~X, log='y')
model <- lm(log10(Y) ~ X)
abline(model)
predict(model, data.frame(Y=log10(1000000)))
```
I get a funny answer:
```
      1       2       3       4       5       6       7       8
4.00000 4.30103 4.60206 4.90309 5.20412 5.50515 5.80618 6.10721
Warning message:
'newdata' had 1 row but variables found have 8 rows
```
but:
```
Y
1 6
```
What is the correct use?
Thank you
On Mon, Jan 25, 2021 at 3:20 PM Luigi Marongiu <marongiu.luigi at gmail.com> wrote: