nls - Warning in install.packages : package ‘nls’ is not available for this version of R

I'm using R version 4.04.

install.packages('nls')
Installing package into ‘/home/gpc/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘nls’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

I'm working through some basic exercises in a textbook here ('Try it #3, just over a 3rd of the way down').

The data frame is provided:

ti3_df <- data.frame(
  x = 0:15,
  y = c(3.493, 5.282, 6.357, 9.201, 11.224, 12.964, 16.226, 18.137,
        19.590, 21.955, 22.862, 23.869, 24.243, 24.344, 24.919, 25.108)
)

Along with the question:

Use logistic regression to fit a model to these data.

Apparently the wording here is not great, and folk over on stats.stackexchange prefer the term 'logistic growth' or 'sigmoid growth curve' over logistic regression for this context.

The linked solutions over there reference the nls package e.g.

nls(density ~ SSlogis(log(conc), Asym, xmid, scal),+ DNase1)

But per the above, I'm unable to install this nls package.

Are there any alternative solutions in R for fitting a logistic-growth-curve outside of nls package?

There is no nls package, I think you are actually referring to the nls() function which is part of the stats package.

1 Like

Thank you. I was confused from this post, where the accepted answer has many upvotes and starts of with library('nls').

Hm, actually, as far as I can tell the function being referred to in that post is different from the stats::nls one?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.