Susannah Cowtan

81 Followers
155 Following
22 Posts
I'm a postgraduate researcher, in adaptive clinical trial design methodology. It's quite a change from using occupancy modelling to look at marine mollusc range changes, but it's still #rstats and #bayesian.

Someone sorted it! Apparently you can put backticks around the whole function name (which does not display well in Mastodon on android, alas):

`tsum.minrep::accr` <- function(x) {
tsum(x@accrual)
}

More #rstats #s7 dispatch woes. Trying to write an S3 method for a S7 class which operates on an attribute which is an array, and also on an array directly. Can't use a S7 method because S7 doesn't have class_array(). Can't use the S3 method because I'm trying to follow best practice and export the class as package::class. Minrep on this stackoverflow post: https://stackoverflow.com/questions/78989779/specifying-name-of-s3-method-on-s7-class-when-s7-class-is-exported-as-packagenam

Can anyone help?

Specifying name of S3 method on S7 class when S7 class is exported as packagename::class

This should be tagged r-S7 but I don't have enough reputation to create it. I am writing a package in {S7} and wish to follow the recommendation that classes exported from the package are exported ...

Stack Overflow
@visnut oh that's really nice, thank you!
@nrennie oh that's nice! I need a way to avoid going down a massive rabbit hole atm
Does anyone here know a good way of making a 3d ternary plot of a surface in R? I'm guessing I may have to learn rayshader... #rstats
I can't seem to create an #S7 object that inherits from base class array or matrix, so unless I'm being spectacularly stupid (always an option) S7 won't do the job anyway; my data structures are irretrievably 3d #rstats
@Lluis_Revilla That's a good reason not to use it yet, indeed. Thanks for the clarification.
#S7 does just what I want, but dare I use it in anything that needs to be maintainable? OO R implementations get replaced so quickly. Is it better to just pretend the only options are #S3 and #S4? #rstats
@Lluis_Revilla yes, I dug around in there but couldn't find the right switch. Talking to the maintainers is probably a good plan.
Can anyone here tell me how to stop the #vscode #R linter highlighting lines where I define functions which have a na.rm argument, because it's not snake case? I've read as much as I could find about linter options but couldn't find the right one (camel case option yes, dot case no). The highlighted lines are distracting my brain ferrets, and I won't change the case of the option, because standards are a Thing.