a few questions regarding IsoriX

76 views
Skip to first unread message

to.diana.f

unread,
Jul 29, 2021, 10:14:22 AM7/29/21
to IsoriX
Hello everyone, thank you for adding me to the group!

I'm Diana, a geography student from Tübingen, Germany, and I'm currently writing my bachelor thesis on dragonfly migrations in the Baltic States.

I am trying to determine the origin of dragonflies (Aeshna mixta) based on
stable hydrogen isotopes (d2H). While searching for a method I discovered the IsoriX package and I'd really like to use it for my work on the determination of the natal origins of the dragonflies.

For training, I did the assignment with Alien data and the Bat dataset which worked out perfectly. Now I am trying to deal with my own data, but I am still facing some problems and I'd have a few questions regarding several functions since I am stuck on the final assignment. Maybe the answer can be found here :)
I'm still a beginner in the whole topic, so sorry in advance for possible stupid questions and a lack of overview on more complex R topics. 

First, I wanted to ask in general if the "GNIPDataEUagg" dataset can be used directly. It has exactly the spatial extent I would like to investigate, so I could use it directly and do the analysis without downloading the data via the GNIP if that would be possible.

Also, I wanted to ask if it would be theoretically possible to work with a calibration dataset that has not been fitted via calibfit. I don't have any reference data except hydrogen isotope values for the location and the wing of each dragonfly and it is hopeless to get further data about location, elevation etc..
I only have complete data for 5 stationary dragonflies (Aeshna cyanea), which are not suitable according to my supervisor.
So if there's the possibility to somehow import a calibration dataset (I have an excel spreadsheet with data on d2Hwing - and the d2H values from the finding place of several dragonflies) I would be very happy.

Nevertheless, I wanted to try how the workflow could work with my data and a provisional calibration dataset "built" from the data for the 5 dragonflies and how
the results could look like.
I have worked with the GNIPDataEUagg dataset and up to the function "isofind" everything has worked so far. Unfortunately, when I use isofind, I always get the following error message:

AssignmentAMi <- isofind(data = AssignDataAMi,
+ isoscape = IsoscapeEU,
+ calibfit = CalibACy)
[1] "computing the test statistic and its variance..."
[1] "running the assignment test..."
[1] "combining assignments across samples..."
Error in .doExtract(x, i, drop = drop) :
   no data associated with this Raster object

Timing stopped at: 13.98 5.5 22.81


I'm afraid I don't know at all where my error is there, I don't know if it's obvious from my description and the code fragment either, but maybe you happened to have seen the error message before at some point and know what the catch might be there.

Last but not least I have a short, probably stupid question: What do the triangles and X on the assignment maps and the isoscape represent? I'm sure that this is somewhere in the description of the functions to find, but could not find it so far unfortunately or have overlooked it. Is it the stations where the isotope data was collected ? Or the finding
places of individuals? Or weather stations?

Thank you a lot in advance

Diana Fiedler

Alexandre Courtiol

unread,
Aug 6, 2021, 4:01:15 PM8/6/21
to IsoriX
Hi Diana, sorry for the late reply.

On Thursday, 29 July 2021 at 16:14:22 UTC+2 to.diana.f wrote:
Hello everyone, thank you for adding me to the group!

I'm Diana, a geography student from Tübingen, Germany, and I'm currently writing my bachelor thesis on dragonfly migrations in the Baltic States.

I am trying to determine the origin of dragonflies (Aeshna mixta) based on
stable hydrogen isotopes (d2H). While searching for a method I discovered the IsoriX package and I'd really like to use it for my work on the determination of the natal origins of the dragonflies.

For training, I did the assignment with Alien data and the Bat dataset which worked out perfectly. Now I am trying to deal with my own data, but I am still facing some problems and I'd have a few questions regarding several functions since I am stuck on the final assignment. Maybe the answer can be found here :)
I'm still a beginner in the whole topic, so sorry in advance for possible stupid questions and a lack of overview on more complex R topics. 

First, I wanted to ask in general if the "GNIPDataEUagg" dataset can be used directly. It has exactly the spatial extent I would like to investigate, so I could use it directly and do the analysis without downloading the data via the GNIP if that would be possible.

Yes, I think you can (legal matters are not my expertise) but please do give due credit to the "GNIP Project IAEA Global Network of Isotopes in Precipitation: https://www.iaea.org".

Also, I wanted to ask if it would be theoretically possible to work with a calibration dataset that has not been fitted via calibfit. I don't have any reference data except hydrogen isotope values for the location and the wing of each dragonfly and it is hopeless to get further data about location, elevation etc..

That is problematic.
I know that most would like this to be possible but the problem of using a slope and intercept computed outside IsoriX is that it would imply to drop many sources of uncertainties.
For example, the hydrogen isotope value at the location should vary with time and it varies more in some location than in others, and IsoriX does take that into account.
If I allow people to plug in their calibration, then there is no way to compute such things and the assignments are likely to be very inaccurate and yet will give a false feeling of confidence since the sources of uncertainties will be swept under the rug.
I don't know if I want to allow that because it is a slippery slope.
I could perhaps code that anyway and plaster the screen with warning messages but I am afraid that then people will just be excited about their results and forget about the warnings.
So currently it is not possible, that was a choice, I could change this, but I hope you all understand my reluctance.

 
I only have complete data for 5 stationary dragonflies (Aeshna cyanea), which are not suitable according to my supervisor.
It is not much but if they come from isotopic regions that are very different, it could perhaps work. Give it a try: IsoriX should account for the uncertainty, so the limitation will appear in the assignment maps.
 
So if there's the possibility to somehow import a calibration dataset (I have an excel spreadsheet with data on d2Hwing - and the d2H values from the finding place of several dragonflies) I would be very happy.
Me too, but without location we are missing something. Cannot you at least get a very rough location? The person that sampled them must know.
 
Nevertheless, I wanted to try how the workflow could work with my data and a provisional calibration dataset "built" from the data for the 5 dragonflies and how
the results could look like.
I have worked with the GNIPDataEUagg dataset and up to the function "isofind" everything has worked so far. Unfortunately, when I use isofind, I always get the following error message:

AssignmentAMi <- isofind(data = AssignDataAMi,
+ isoscape = IsoscapeEU,
+ calibfit = CalibACy)
[1] "computing the test statistic and its variance..."
[1] "running the assignment test..."
[1] "combining assignments across samples..."
Error in .doExtract(x, i, drop = drop) :
   no data associated with this Raster object

Timing stopped at: 13.98 5.5 22.81

That is weird, I have never seen that.
Does the official example works on your system? to check, try the following

options_IsoriX(example_maxtime = 300)
example("isoscape")

If that works, then please share your script and send me privately your data, so I can debug that!



I'm afraid I don't know at all where my error is there, I don't know if it's obvious from my description and the code fragment either, but maybe you happened to have seen the error message before at some point and know what the catch might be there.

Last but not least I have a short, probably stupid question: What do the triangles and X on the assignment maps and the isoscape represent? I'm sure that this is somewhere in the description of the functions to find, but could not find it so far unfortunately or have overlooked it. Is it the stations where the isotope data was collected ? Or the finding
places of individuals? Or weather stations?

Not stupid, and I should probably clarify that.
In the help file for ?plots you will see that the function drawing the assignments map has the following default parameters:
sources = list(draw = TRUE, cex = 0.5, pch = 2, lwd = 1, col = "red"),
calibs = list(draw = TRUE, cex = 0.5, pch = 4, lwd = 1, col = "blue"),
assigns = list(draw = TRUE, cex = 0.5, pch = 5, lwd = 1, col = "white")
So the red symbols are the position of, in your case, weather stations. The blue ones are position of the sedentary dragonflies. The white one are the location where the sample to assigned were collected (not where they are assigned).
You can tinker with these options if you want to change the display or prevent the display.

The symbols are defined by "pch", this is usual R stuff for plot: call ?pch and scroll down in the help file and you will see to which symbol each number corresponds to.

++

Alex

to.diana.f

unread,
Aug 18, 2021, 4:06:11 PM8/18/21
to IsoriX
Hi Alex,

Thank you so much for your answer and also sorry for the late reply. 

Unfortunately, for now I had to use the method in which I work in R and a geoinformation system, because my deadline for the thesis is unfortunately fast approaching and my supervisor is also currently out of town and difficult to be contacted. 

Even though I probably won't have enough time to use IsoriX in my thesis, I would still like to try it out. In the end I hope to be able to compare the results of the method I am currently using and the assignment with IsoriX.  I would find it very interesting to compare both methods directly, so I will stay on that.

All right, then I will inform myself again regarding the credits.

Regarding working without a calibration dataset, I understand well why this is not very useful and it is not possible in IsoriX. Unfortunately I couldn't find out any locations of dragonflies from my calibration dataset until today, but I'm still working on it and hope to achieve something. 

I'll also try to run the code again based on a calibration with the 5 Aeshna cyanea with known origin and see if the error message can be fixed with your suggestion. 

Ah, thanks again for explaining what the symbols are all about, now everything is clear to me :)

Thanks again for the detailed answer and I will definitely update if and how it worked out! 

Best regards
Diana

Reply all
Reply to author
Forward
0 new messages