Forums

Back

Issue with SS_writedat_3.30

MC
Massimiliano Cardinale, modified 4 Years ago.

Issue with SS_writedat_3.30

Youngling Posts: 40 Join Date: 2/23/17 Recent Posts

Dear

 

I am trying to use SS_writedat_3.30 to produce fishing by fleet plots. It was working before (this winter) but after updating r4ss package I now get this error when using the function:

 

 

 

running SS_writedat_3.30

opening connection to ~/Max files for backup/Documents/Commitees/ICES/WKBENCH/WKBENCH 2019/EBC/Fishing impact by fleet\Fishing_impact_by_fleet\EBcod_wgbfas19_dat.ss

Error in `[.data.frame`(catch.out, , c("year", "seas", "fleet", "catch", :

undefined columns selected

 

Anyone has an idea on what it could be the culprit?

 

Cheers

 

Max

 

KJ
Kelli Faye Johnson, modified 4 Years ago.

RE: Issue with SS_writedat_3.30

Youngling Posts: 28 Join Date: 6/13/17 Recent Posts

The SS-writedat_3.30 function was not meant to be used by itself. Instead, users should be using SS_writedat(..., version = "3.3"). Also, it could be that your data frame of catches are in wide format and should instead be in long format, which is how SS now reads catches. The error is suggesting that you don't have the column names of "year" "seas" "fleet" "catch" and "catch_se" in your data frame. 

KJ
Kelli Faye Johnson, modified 4 Years ago.

RE: Issue with SS_writedat_3.30

Youngling Posts: 28 Join Date: 6/13/17 Recent Posts

Great, thank you for sharing the file. I was able to read and write the file from the disk using r4ss. Are you reading in the file, making changes using R, and then trying to write the file back to the disk? Feel free to email me (kelli.johnson@noaa.gov) an .RData file with the R object and your code so that we can debug a bit off of this thread.