ropensci / paleobioDB

R interface to the Paleobiology Database
https://docs.ropensci.org/paleobioDB
42 stars 17 forks source link

more options with mapping #52

Open meghalithic opened 3 years ago

meghalithic commented 3 years ago

Hi!

It'd be great to have more options when it comes to mapping occurrences. Like, choosing the point size or color to represent number of occurrences or richness. Or, to add color to represent temporal extent.

I am also curious what grid cell size is used for binning occurrence? I tried looking through the functions, but couldn't figure out how "pdbd_map_occur" bins the occurrence data.

Thanks!

SaraVarela commented 3 years ago

you can pass all the arguments from the plot function, meaning, you can change the colours of the points, based on any vector that you want (time, in your example), or just red, or any color that you want.

the bins you can also define them and change them as you want.

hope this help!

castroinsua commented 9 months ago

While it is true that the users can pass some additional parameters to pbdb_map, they cannot really specify any arbitrary colour vector, since this will be overridden by the argument that is used to choose the colours for the gradient (col.point). Also, this function internally generates a new dataframe to count the number of occurrences per coordinate, which the users cannot access, and therefore they cannot know how to properly specify a vector of sizes or colours.

As things are right now, in this scenario there could also be problems with the legend, since the function passes the same arguments (...) to the function that plots the points and the function that plots the legend.

We could simply add an option to make the size of the points proportional to the number of occurrences, if enough people want this feature.

The problem that prevents giving more control to the users is that the dataframe that is used to actually do the plotting is not the one that is passed to the plotting function.

I am also curious what grid cell size is used for binning occurrence?

To add to Sara's response above, this is controlled by the res argument, which changes the raster resolution in degrees. By default it has a value of 5.