Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stamp.direction(...): "ModConeModel" cannot be called using the arguments #1

Open
JacksonKusack opened this issue Oct 11, 2023 · 3 comments
Assignees

Comments

@JacksonKusack
Copy link

The ModConeModel option for directional analyses isn't available within the function (Note, I moved the directional methods functions outside of the main 'stamp.direction(...) function in my version):

stamp.direction <- function(stmp,dir.mode="CentroidAngle",ndir=4,group=FALSE){
  #Compute function results based on input method.
  crs_orig <- st_crs(stmp)
  stmp <- st_transform(stmp,crs=4326)
  
  stmp <- switch(dir.mode,
                 CentroidAngle = CentroidAngle(stmp,group),
                 ConeModel = ConeModel(stmp,ndir),
                 MBRModel = MBRModel(stmp),
                 #ModConeModel = ModConeModel(stmp,ndir),
                 stop(paste("The direction method does not exist: ",dir.mode)))
  
  stmp <- st_transform(stmp,crs=crs_orig)
  return(stmp)  
}

I assume it is meant to be available, as the help documentation mentions that the function has been altered in this version:

"ModConeModel" – The modified cone model first computes the centroid of the T1 events. Then ndir = 4 or 8 cones are created outward from this centroid to the minimum bounding rectangle of the entire grouping. As described by Robertson et al. (2007) this approach is more accommodating to polygon groups that are irregular in size or shape. The modified cone model method first computes the centroid of all T1 polygons in a STAMP grouping. It then computes the bounding box of ALL events in a STAMP grouping. Then, ndir=4 or 8 cones are computed. In the case of ndir=4, cones radiate from the T1 centroid to the four corners of the bounding box. The result of the modified cone model method is that the cones are not equally spaced, but tailored to the individual STAMP groupings shape. See Robertson et al. (2007) for more detailed information. NOTE: This function has been altered slightly as of stampr v 0.3.

It's an easy fix, just wanted to bring it to your attention.

@jedalong
Copy link
Owner

@JacksonKusack im going in the field starting thursday can we meet on a coding cafe in november to sort out these issues! thanks for the help! Jed

@JacksonKusack
Copy link
Author

Sounds good to me - good luck in the field!

@jedalong jedalong self-assigned this Feb 2, 2024
@jedalong
Copy link
Owner

jedalong commented Feb 2, 2024

  • Note to @jedalong make sure to check how to include stamp.direciton functions as these need to be internal or CRAN will require documentation.
  • Look into feasability of rewriting modconemodel code, for now remove from documentation and paramter options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants