Skip to content

getIndicesAllYears #35

@arni-magnusson

Description

@arni-magnusson

Hi, I found a couple of semi-useful functions from 2019 on my hard drive, which could be considered for the icesDatras package.

The current functionality in icesDatras is that users need to call getIndices() for each year and then somehow combine the results into one data frame. The goal is to automate this task and allow users to fetch age-based indices of abundance by species and survey for all years.

I remember that when I experimented with this, I was evaluating alternative ways to write such a function. One was to write a simple function that calls existing functions, but this had a significant overhead - especially when working on a computer that is physically distant from the database in ICES HQ. Another way would be to hand code the function to make it faster and avoid submitting and waiting for multiple redundant queries from the database in ICES HQ.

See getIndicesAllYears() and getIndicesAllYears2() below. I see in the comments of the first function I had taken notes for testing its performance: 21 sec when run on a laptop in ICES HQ, 94 sec when run on the same laptop elsewhere in Copenhagen. For the second function, I don't see performance notes, presumably because I was still developing it. In short, getIndices() makes several check calls that are very sensible when submitting one query, but perhaps not sensible to repeat nyear times in a loop.

At any rate, it would feel wrong to delete these experiments, so I thought pasting them here would be a better thing to do :)

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions