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

Other
0 stars 0 forks source link

hardcoded filenames #229

Closed mle2718 closed 9 months ago

mle2718 commented 9 months ago
  1. We need to have code that makes these .Rds files. The filenames also look a little funky.
  2. Please use here() to refer to files. https://github.com/NEFSC/READ-SSB-CHAJI-Effort-Displacement---Scallop/blob/c1138c73ded00f820f2df62fa6e816a2e9aa3852/analysis_code/case_study_comparisons.Rmd#L21-L27
mchaji commented 9 months ago

Do you know of an easy way to save the data up to a certain point using the shapefile inputs? I'm thinking there's a vintage string work around but Its not coming to me

mle2718 commented 9 months ago

Do you know of an easy way to save the data up to a certain point using the shapefile inputs? I'm thinking there's a vintage string work around but Its not coming to me

Not sure if I understand this question. Do you want to save the data after a spatial join? Take a look at the back end of the data_extracting.Rmd.

mchaji commented 9 months ago

Do you know of an easy way to save the data up to a certain point using the shapefile inputs? I'm thinking there's a vintage string work around but Its not coming to me

Not sure if I understand this question. Do you want to save the data after a spatial join? Take a look at the back end of the data_extracting.Rmd.

I do, but with the same of the input shapefile attached i.e. NY2

mle2718 commented 9 months ago

This is how we do it at the back end of the data_extracting.Rmd.

So you could do something similar to create and save the data after the spatial join.

save to RDS

all_yrs_costs_name <-paste0("all_yrscosts",vintage_string,".Rds") saveRDS(all_yrs_costs, file=here("data","intermediate",all_yrs_costs_name))

mchaji commented 9 months ago

This should be okay now, but I'll wait to close after verifying

mle2718 commented 9 months ago

Okay, so I have knit the tiny report.

Then I knit the case_study_comparisons.Rmd. I get this error:

  1. base::load("~/mchaji_net/READ-SSB-CHAJI-Effort-Displacement---Scallop/data/main/comparisons/comparasion_data_ALL.RData")
  1. Please modify this to the here() syntax for loading in data.
  2. How does "comparasion_data_ALL.RData" get created?

Do I have to run the tiny_report 6 or 12 times, changing the input shapefile and the saveRDS line? What do I need to do the GC tables?

mchaji commented 9 months ago

Okay, so I have knit the tiny report.

Then I knit the case_study_comparisons.Rmd. I get this error:

  1. base::load("~/mchaji_net/READ-SSB-CHAJI-Effort-Displacement---Scallop/data/main/comparisons/comparasion_data_ALL.RData")
  2. Please modify this to the here() syntax for loading in data.
  3. How does "comparasion_data_ALL.RData" get created?

Do I have to run the tiny_report 6 or 12 times, changing the input shapefile and the saveRDS line? What do I need to do the GC tables?

I'm working on 1 & 2. I'm having the same issue knitting since I ran the chunks - in hindsight I should have done both.

For #3 you would have to have to run the scallop analysis a total of 12 times for record keeping purposes they are:

  1. Central Atlantic Call Area (1) - LA
  2. Central Atlantic Draft WEA (2) - LA
  3. Central Atlantic Final WEA (3)- LA
  4. Central Atlantic Call Area (1)- GC
  5. Central Atlantic Draft WEA (2)- GC
  6. Central Atlantic Final WEA (3)- GC
  7. New York Bight Call Area (1) - LA
  8. New York Bight WEA (2) - LA
  9. New York Bight Lease Areas(3) - LA 10 New York Bight Call Area (1) - LA
  10. New York Bight WEA (2) - LA
  11. New York Bight Lease Areas(3) - LA

I know that's a horrible ask so until I can work out an easier alternative I have the .RData loading in

mle2718 commented 9 months ago

:

1. Central Atlantic Call Area (1) - LA

2. Central Atlantic Draft WEA (2) - LA

3. Central Atlantic Final WEA (3)- LA

4. Central Atlantic Call Area (1)- GC

5. Central Atlantic Draft WEA (2)- GC

6. Central Atlantic Final WEA (3)- GC

7. New York Bight Call Area (1) - LA

8. New York Bight WEA (2) - LA

9. New York Bight Lease Areas(3) - LA
   10 New York Bight Call Area (1) - LA

10. New York Bight WEA (2) - LA

11. New York Bight Lease Areas(3) - LA

It's fine. I know how to adjust the loop to deal with this.

mle2718 commented 9 months ago

231 closes