-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calRaster output not working with pdRaster #42
Comments
Hard to say for sure w/o a reproducible example that I can run, but my hunch is that it could be related to using a RasterBrick as input to calRaster. assignR transitioned away from the depreciated raster package a few versions back and although we're trying to continue to provide backwards compatibility you should use terra spatial objects for best performance and stability. You could try: c200_terra = rast(c200_both) and then use the result as your isoscape input to calRaster. If that doesn't work please provide example data that I can use to reproduce the problem. -Gabe |
Hi Dr. Bowen,
Thank you for your response.
I am still getting "NULL" in the console after transforming the RasterBrick to a SpatRaster and using that as the isoscape input to the calRaster function.
Attached is my script, sample data, and required rangefiles for generating the spatial objects.
I appreciate your time in this!
Carlie Saline
…________________________________
From: Gabriel Bowen ***@***.***>
Sent: Wednesday, October 23, 2024 5:45 PM
To: SPATIAL-Lab/assignR ***@***.***>
Cc: Saline, Carlie ***@***.***>; Author ***@***.***>
Subject: Re: [SPATIAL-Lab/assignR] calRaster output not working with pdRaster (Issue #42)
Hard to say for sure w/o a reproducible example that I can run, but my hunch is that it could be related to using a RasterBrick as input to calRaster. assignR transitioned away from the depreciated raster package a few versions back and although we're trying to continue to provide backwards compatibility you should use terra spatial objects for best performance and stability.
You could try:
c200_terra = rast(c200_both)
and then use the result as your isoscape input to calRaster. If that doesn't work please provide example data that I can use to reproduce the problem.
-Gabe
—
Reply to this email directly, view it on GitHub<#42 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BML4JOLX2WJGZM6M2PTZ5ALZ5ARHFAVCNFSM6AAAAABQPZB7TKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZTGY3DENJWHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Carlie – Looks like your files didn’t attach to the github issue…if you can’t figure out how to do that you can email me directly ***@***.******@***.***>).
Gabe
From: salinedi0n ***@***.***>
Sent: Thursday, October 24, 2024 12:44 PM
To: SPATIAL-Lab/assignR ***@***.***>
Cc: GABRIEL J BOWEN ***@***.***>; Comment ***@***.***>
Subject: Re: [SPATIAL-Lab/assignR] calRaster output not working with pdRaster (Issue #42)
Hi Dr. Bowen,
Thank you for your response.
I am still getting "NULL" in the console after transforming the RasterBrick to a SpatRaster and using that as the isoscape input to the calRaster function.
Attached is my script, sample data, and required rangefiles for generating the spatial objects.
I appreciate your time in this!
Carlie Saline
…________________________________
From: Gabriel Bowen ***@***.***<mailto:***@***.***>>
Sent: Wednesday, October 23, 2024 5:45 PM
To: SPATIAL-Lab/assignR ***@***.***<mailto:***@***.***>>
Cc: Saline, Carlie ***@***.***<mailto:***@***.***>>; Author ***@***.***<mailto:***@***.***>>
Subject: Re: [SPATIAL-Lab/assignR] calRaster output not working with pdRaster (Issue #42)
Hard to say for sure w/o a reproducible example that I can run, but my hunch is that it could be related to using a RasterBrick as input to calRaster. assignR transitioned away from the depreciated raster package a few versions back and although we're trying to continue to provide backwards compatibility you should use terra spatial objects for best performance and stability.
You could try:
c200_terra = rast(c200_both)
and then use the result as your isoscape input to calRaster. If that doesn't work please provide example data that I can use to reproduce the problem.
-Gabe
—
Reply to this email directly, view it on GitHub<#42 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BML4JOLX2WJGZM6M2PTZ5ALZ5ARHFAVCNFSM6AAAAABQPZB7TKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZTGY3DENJWHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***<mailto:***@***.***>>
—
Reply to this email directly, view it on GitHub<#42 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACGLIN37IZW2YMFOKOVPLRDZ5E5WJAVCNFSM6AAAAABQPZB7TKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZWGEYDGNRSGY>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
The page didn't support the file types for creating the shapefiles, so I've invited you to a private repository where you can access the materials. |
Carlie - Thanks, that made it easy to troubleshoot. I created a branch in your repo and pushed an update to your script that demonstrates the problem. You're trying to run calRaster using a known origin dataset that appears to include individuals from only one location. calRaster fits a linear model relating the known origin sample values to the environmental isoscape values. The model can't be fit without at least two 'points' (known origin data from at least two locations...ideally many more). It looks like we haven't protected against this, I'll make a point of adding error checking to catch this in a future version. Because the scaling between water isotope values and animal tissues often deviates from 1:1 (e.g., https://doi.org/10.1371/journal.pone.0035137) it's pretty risky to do isotope geolocation using known origin data from only one site. You could force this...for example by applying a fixed offset to the environmental isosocape values to produce your feather (I assume) isoscape, but that implies the scaling is 1:1. If you don't have your own Junco known origin data for additional sites you might look for additional sites in the literature or in the knownOrig database that is packaged w/ assignR. It looks like the only Junco species represented in the database is from the western USA, so you might have to consider falling back on data from other similar species. |
Hi Gabe, thank you for the response. Yes, we unfortunately only have known origin junco samples from the one biological research station. Moving forward with guild- and range-similar species. I appreciate all the help! |
Hello,
I'm a grad student using your package and am very grateful for it! Thank you!
I was wondering if you have experienced issues like this before -- the output of the calRaster function is not working with the pdRaster function.
I have an isoscape (with both the d2h values and standard error) together in the RasterBrick object "c200_both". The file with my known origin samples is "ultra_known_origins".
I can run the following fine:
calibrated <- calRaster(known = ultra_known_origins, isoscape = c200_both, interpMethod = 1, genplot = FALSE, verboseLM = TRUE)
It returns the object "calibrated" as type rescale and list of 3.
When I run:
unknowns_prob = pdRaster(calibrated, as.data.frame(Feather_d2h_for_R))
All I get back is "NULL".
Sometimes when I run the calRaster function, I get a warning that the function will make the object no longer an s4 object.
Do you know what I'm doing wrong?
Thank you for your time!
The text was updated successfully, but these errors were encountered: