Skip to content

plotfit() returning error on data with multiple independent variables #8

Description

@wolterstori

Hi,

We are working on a non-linear regression using estimated vs observed chlorophyll and found the nlstools package... everything else has worked except plotfit(), where I received the following error:

formulaExp <- as.formula(Estimated ~ ((Rrs704/Rrs665) * (a + (1.61 * Rrs740)/(0.082 - 0.6 * Rrs740)) - b - (1.61 * Rrs740)/(0.082 - 0.6 * Rrs740)^d)/c)
preview(formulaExp, data = Gons740, start = list(a = 0.70, b = 0.40, c = 0.016, d = 1.06))
Chl.nls1<- nls(formulaExp, start = list(a = 0.70, b = 0.40, c = 0.016, d = 1.06), data = Gons740)
overview(Chl.nls1)
plotfit(Chl.nls1, smooth = FALSE)
Error in (function (formula, data = NULL, subset = NULL, na.action, drop.unused.levels = FALSE, :
invalid type (list) for variable 'd[, vardep]'

I ran through a couple examples as well... first using the O2K dataset (no issues) and the Michaelis Menten vmkmki dataset. I received the same error on the vmkmki dataset.
View(vmkmki)

def.par <- par(no.readonly = TRUE)
par(mfrow = c(2,2))
nls2_c <- nls(compet_mich, vmkmki, list(Km=1,Vmax=20,Ki=0.5))
plotfit(nls2_c, variable=1)
Error in (function (formula, data = NULL, subset = NULL, na.action, drop.unused.levels = FALSE, :
invalid type (list) for variable 'd[, vardep]'

Any guidance you can offer would be much appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions