question about prepsources function

25 views
Skip to first unread message

sami dodino

unread,
Apr 5, 2022, 2:45:38 AM4/5/22
to IsoriX
Hi All,
Thank you for letting me join the group! I work with penguins at Tierra del Fuego, Argentina and I want to use d13C and d15N of zooplacton collected arround this area to predict penguins foraging areas. 
I used the IsoriX scrip and when I ran the command prepsources I recieved these issues:
"Some latitude values are not unique but should be, so the first element was taken among"
"Some longitude values are not unique but should be, so the first element was taken among"
"Some elevation values are not unique but should be, so the first element was taken among"
It is correct that I have more than value for the same latitude but I would like use all the data to building the isoscapes. My tables is like this:
 rawBASE <- read.csv("isoscapebase_OnlyCope.csv")
> head(rawBASE)
  source_ID       lat      long           elev  year month  source_value
1       BBN -54.40563 -61.49657 -199 2015     2    -23.43080
2       BBN -54.53117 -62.90442 -503 2016     4    -21.31421
3       BBN -54.46222 -63.24798 -362 2016     4    -20.25698

Why I receive this issue? I tried to keep running the code even with that error but then the plot(isoscape) only shows the fit for 3 points and nothing more.

Also, I tried to use a bathymetric raster download from gebco instead of the proposed elevation raster in the Isorix example, but it doesn't work :(. Is there a way to choose this raster change? Or maybe not?
In my table, the elevation column is actually the depth.

Thank you in advance for your insight.
Best,
Samanta

Alexandre Courtiol

unread,
Apr 5, 2022, 7:53:24 AM4/5/22
to IsoriX
Hi Samantha,

The function `prepsources()` job is to take single measurements through time and to aggregate them for each location.
We developed that to handle weather station data.
In your case, you should skip this function altogether and directly create a data frame or tibble similar to what this function usually produces.

Here is an example of output for terrestrial data:

               source_ID mean_source_value var_source_value n_source_value   lat  long elev
1          BAD SALZUFLEN         -49.57500        123.61929              8 52.10  8.75  135
2                 BERLIN         -50.63125        132.25067              8 52.46 13.40   48
3           BRAUNSCHWEIG         -36.10000         85.51143              8 52.29 10.44   81
4               CUXHAVEN         -45.90000        156.42000              8 53.87  8.70    5
5               EMMERICH         -42.67500        208.13071              8 51.83  6.25   43
6 GARMISCH-PARTENKIRCHEN         -61.80000        304.84000              8 47.48 11.06  719

So as you can see, it should not be difficult to generate yourself.
The first column needs some kind of ID that would be unique for each location.
Then comes mean_source_value, var_source_value and n_source_value, which indicate the mean, variance and number of point for a given isotope at the corresponding location.
Finally, lat, long, elev are needed for fitting the model, for you elev should be the depth.

Just make sure the column names are correct.

For your other issues, I already replied directly from my private email box where you sent more questions.

Best,

Alex

sami dodino

unread,
Apr 14, 2022, 8:20:46 AM4/14/22
to IsoriX
Great! Thank you so much!
Reply all
Reply to author
Forward
0 new messages