gjearevoll / BioDivMapping

A pipeline dedicated to analysing and visualising the biodiversity of different taxa in Norway
GNU General Public License v3.0
5 stars 3 forks source link

Error adding ANOData data to predictionIntercept in Richness model. #101

Open RRTogunov opened 7 months ago

RRTogunov commented 7 months ago

https://github.com/gjearevoll/BioDivMapping/blob/dc5f65ce29269b60c1a8d02200988b44387d6708/pipeline/models/speciesModelRuns.R#L92-L93

Error adding ANOData data to predictionIntercept in Richness model. Presumably, this happens when a species group does not have any ANO data.

>   workflow$modelOptions(INLA = list(num.threads = 12, control.inla=list(int.strategy = 'eb', cmin = 0),safe = TRUE),
+                         Richness = list(predictionIntercept = 'ANOData'))
Error in workflow$modelOptions(INLA = list(num.threads = 12, control.inla = list(int.strategy = "eb",  : 
  predictionIntercept needs to be a name of one of the datasets in the model.

We need a function that finds a relevant dataset for each species group.

samaperrin commented 7 months ago

Yep this will happen when there's no data in ANO for a given taxa/region. I don't think we can automate this, the dataset needs to be selected manually. Unless we want to create a list of suitable datasets by taxa and have a function that selects a dataset based on presence of suitable data and returns an error if there are none?

Peprah94 commented 5 months ago

There is a problem with obtaining the ANOData for the entire Norway. Merging the SurveyPoint and the ANO_Art has no common Global ID. Therefore, it is impossible to get a dataset from ANOData in Norway, unless we can find another way of merging the two dataframe to obtain the ANOData required.