NEFSC / READ-SSB-CHAJI-Effort-Displacement---Scallop

Other
0 stars 0 forks source link

knit_scallop_analysis_loop.R non functional #204

Closed mle2718 closed 1 year ago

mle2718 commented 1 year ago
    Are either of you getting this error?
Quitting from lines 800-821 (scallop_analysis_0322.Rmd) 
Error in `dplyr::summarise()` at FishSET_RPackage/R/utils.R:1211:8:
! Problem while computing `..1 = dplyr::across(dplyr::all_of(value), .fns = match.fun(fun))`.
ℹ The error occurred in group 0: character(0).
Caused by error in `get()`:
! object '%' of mode 'function' was not found
Backtrace:
  1. ... %>% ...
 13. base::match.fun(fun)
 14. base::get(as.character(FUN), mode = "function", envir = envir)

It has to do with my hacky fix for the zone plots.

Originally posted by @BryceMcManus-NOAA in https://github.com/NEFSC/READ-SSB-CHAJI-Effort-Displacement---Scallop/issues/175#issuecomment-1320550789

I get this error when I try to knit multiple reports using the knit_scallop_analysis_loop.R code. I can run the scallop_analysis when I pass in the wind_sf_final.RDS,""wind_sf_nocable.RDS," or "Wind_NY2.RDS" by hand.

When I remove the Wind_NY2.RDS, I still get the same error message input_shapefile_vals_to_loop<-c("wind_sf_final.RDS", "wind_sf_nocable.RDS")

mle2718 commented 1 year ago

@mchaji -- any idea what's going on here? For Bryce's problem, he was using the wrong shapefiles. Is there something I need to adjust?

mchaji commented 1 year ago

@mchaji -- any idea what's going on here? For Bryce's problem, he was using the wrong shapefiles. Is there something I need to adjust?

Have you tried clearing your environment? I read that this could be a part of the issue.

mle2718 commented 1 year ago

I almost always restart R and then run the code, so I don't think that's the problem.

This feels like a problem with the way I'm using rmarkdown::render. I don't think this is worth more than an hour or so to troubleshoot.

We can run the scallop analysis with and without the cable routes pretty easily (by hand), or on different fleets or binning gears. It's a bit of a pain to keep track of, but we can do it.

And for the individual areas, I think we need to do something slightly different anyway -- there's so much in the report that we don't need.

mle2718 commented 1 year ago

@mchaji fixed this with https://github.com/NEFSC/READ-SSB-CHAJI-Effort-Displacement---Scallop/pull/175/commits/304af1a71c3c041ff09ecc7d24980eb53aa786e6