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

Other
0 stars 0 forks source link

FishSET folder #185

Closed mle2718 closed 2 years ago

mle2718 commented 2 years ago

@BryceMcManus-NOAA: is there a way to modify this: https://github.com/NEFSC/READ-SSB-CHAJI-Effort-Displacement---Scallop/blob/e185a1dad34943e60d709c4a698915094024b517/analysis_code/scallop_analysis_0322.Rmd#L94-L97

to remove the manual intervention needed to select the FishSETFolder?

I'd like to run the scallop analysis, passing in different shapefiles as parameters.--- basically looping over shapefiles and it probably won't work if I have to manually intervene to select the FishSETFolder. https://bookdown.org/yihui/rmarkdown/params-knit.html

~M

BryceMcManus-NOAA commented 2 years ago

Sure, you can create an empty FishSETFolder in the top directory and use

folderpath <- here("FishSETFolder")

if (project_exists(project) erase_project(project)

Just make sure that folderpath is declared before project_exists() is run. That should prevent the window from appearing. Probably should add FishSETFolder to .gitignore if you go that route.

mle2718 commented 2 years ago

I'm going to do this instead:

  if (project_exists(project)) {
unlink(here(folderpath,project), recursive = TRUE)
  }

This is safe for me, but obviously breaks if the FishSET folder is not inside this project. I'll wrap an "if location==Woods_Hole" around it.

BryceMcManus-NOAA commented 2 years ago

That works too. It would probably be simpler to get rid of the location parameter altogether: it's only purpose was to allow me to import the scallop data from a folder outside the repo, but I've been placing the updated data directly into the data/main folder so isn't necessary anymore.

mle2718 commented 2 years ago

the loc() and locproject() functions are killing me right now.

fortunately for me, I only need to choose the FishSETFolder the first time through the loop.

mle2718 commented 2 years ago

186 will close.