-
Notifications
You must be signed in to change notification settings - Fork 7
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
Bugs in the main function #24
Comments
Hi @GabrieleNocchi,
Thanks, Tom |
Hi Tom,
So, as we are here. I also think that the mapmixture function should have options to specify the column names where sites are stored, where admixture proportion are stored and where lat and long are stored. Maybe it still works or I missed it (in that case my bad), but to be safe I reformatted everything like you. It is a bit tedious to have to reformat the data exactly like yours, it defeat the purpose of the tool (speeding up and ease how to make those maps which can already be done using other things). I don t want to sound over critic, this tool is a great idea, just trying to help.
Note, my code in the attached file only work if you edit the mapmixture function removing those lines I flagged before, else it will throw the error I reported in point 3. Test.png is the "wrong" map produced with mapmixture, while pie_map is what it should look like (don't mind the extra features and graphical stuff, it is the one I coded with mapplots and other libraries). Cheers, |
As a final note, I downloaded from CRAN. Had issues with dependencies when trying to download from GitHub the development version |
While I look into your main issue, on this point please can you let me know what version of R you are using. I recently pushed a change to the documentation because R version 4.2+ is needed for mapmixture to install. If you are using 4.2+ please can you also copy the error message so that I can see what's going on. |
I found the issues: I had a wrong coordinate for Cathedral N in the coordinates file. Also the coordinates file does not have to be per individual, but per site -- only the unique locations without repeating the rows. I fixed it with:
last lines before the mapmixture function is where I "fix" the coord file. |
So everything seems like it is working now. Now also making the map smaller and pie smalle make the pies not overlap -- great! |
OK that's great to hear! Is there anything you want me to look at still or shall I close the GitHub issue? Tom |
It works as intended now I think! Just testing a few of the other functions! |
It all seems good. Amazing, my bad the issue was on my end and also wrong formatting of my coordinates data. It is great now -- finally can do those pie maps using ggplot, I was limited to base R before as the libraries I was using were not compatible with ggplot. Did some quick tests, require a bit of tweaking, but very good results with no much effort: Amazing! Very happy to have found this! |
Hi there,
I was trying to give a try to your tool but I think there are some issues.
These lines in your code causes problems, and I am not sure why are there:
Check coordinate site IDs exactly match admixture site IDs
Why simply not:
Check coordinate site IDs exactly match admixture site IDs
My site names are exactly the same between coordinates and admixture file, but I can t go past this error. This however does not happen with your data. If I remove those lines above from the function, it works. Also note sure why the warning about longer object having to be a multiple.
Also, if the sampling area is small, I can t find a way for the pie not to overlap even when I decrease the pie size and map size, they overlap. If I adjust the limits of the map to make it much smaller (ie 1 degree Lat and 1 degree Lon), it still makes it bigger than specified.
I'd love to use your package but at the moment is much easier to do this from scratch using mapplots draw.pie function:
https://www.rdocumentation.org/packages/mapplots/versions/1.5.2/topics/draw.pie
The text was updated successfully, but these errors were encountered: