Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upgratia::derivatives: "Subscript out of bounds"-error on bs="fs" model #57
Comments
|
With your code I see this:
with the current version on github (not CRAN). This is because an internal function used by So, yes, this is a bug. |
|
Thanks for informing me about this @tomand-uio. I have now fixed this issue in the latest commit to the github version. |
|
?Dear Gavin,
Thank you for the swift and informative reply. I'm looking forward to an even better version of gratia with a solution to this. And thank you for your contributions to the R community and for continuing to write great papers (and a superb blog which I follow avidly)
Best regards,
Tom
________________________________
From: Gavin Simpson <notifications@github.com>
Sent: 06 December 2019 17:45
To: gavinsimpson/gratia
Cc: Tom Andersen; Author
Subject: Re: [gavinsimpson/gratia] gratia::derivatives: "Subscript out of bounds"-error on bs="fs" model (#57)
With your code I see this:
dm <- derivatives(m)
Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, :
'min' not meaningful for factors
with the current version on github (not CRAN). This is because an internal function used by derivatives() to generate data at which to compute the derivative is treating the spline as 2-d and trying to generate a sequence over the factor specified in the smooth.
So, yes, this is a bug.
-
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#57?email_source=notifications&email_token=ALWEYTFJD2ECSEYFHXOTZG3QXJ6SFA5CNFSM4JWOHZN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGEVK5Y#issuecomment-562648439>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALWEYTGU4QJH6PW4XPBKHGDQXJ6SFANCNFSM4JWOHZNQ>.
|
I am trying to use hierarchical GAMs for analyzing microalgal growth curves in 96-well plates, so I fit a "S-type" GAM (cf. Pedersen et al. 2019) and want to extract derivatives to calculate growth rates. The following code shows an example that leads to the error message "Error in .subset2(x, i) : subscript out of bounds" when I try to apply derivatives() to the GAM object.
I can imagine that one possible answer could be that this was never supposed to work, in which case I guess I'll use som combination of predict() and lapply() or similar produce rates of change for each unit. Or maybe I have just misunderstood something, and there is already a simple way to get this right? Or maybe it's an actual bug...