Skip to content

How to use periodogram inside a foreach/dopar construct? #45

@fschiefenhoevel

Description

@fschiefenhoevel

Hi!

Using rethomics for some time now. Great work! I have written a wrapper around the periodogram function which cleans/arranges data and then loops through subsequent time-segments, calculating a periodogram for each segment.

This can take some time, and therefore I am trying to parallelize the calculations. It works ...kind of. The problem is that var within the periodogram function can't be found once periodogram is inside a foreach/dopar loop. Passing FUN and getting it via get(fun) works strangely enough. I think (!) the problem is the way periodogram evaluates var?

Please see this stackoverflow post from me: https://stackoverflow.com/questions/79561941/pass-column-name-as-argument-to-periodogram-function-inside-foreach-loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions