macroecology/mapast

Issues I found

Opened this issue · 14 comments

Hola Sarita,

estou modificando o pacote no meu computador e devo enviar um Push request em breve. Alguns erros que eu encontrar ou sugestões vou colocar aqui.

Besos!

  1. pm_getdara: Error control does not work. When names are not found in paleobioDB error occurs instead of going through:
    print ("There is no data that matches your query on the paleobioDB.
    Check if the spelling, temporal intervals, etc. are correct")

Also, I changed the way to handle the error (you will see in the push request).

  1. For consistency, every time the shape file of the time interval is required the function should allow input the name or the shape itself. Currently it is in one way or the other across different functions. Like pm_plo and pm_occraster.
  1. I suggest remove all the @Usage from the documentation, roxygen fill it automatically and adds the default options, manually writing it only adds errors
  1. rank_filter needs an error control if length(data$matched_rank) == 0. Otherwise it will give an uninformative error beyond.
  1. Needs a function to control the wrong interval names. Give more informative errors in general would be nice, this shall not be too much work as the functions have the same inputs in general.

I am sending my first push, today I got until the pm_occraster

Access denied... How can I send my changes? can you allow me to edit the repo?

@BrunoVilela done! you can push now and change whatever you want :-)

Thanks! pushed the first changes I did.

pm_occ: "generates a diversity matrix, with the number occurrences of each species, genus, family or order per locality"

what is a diversity matrix (a presence absence?)
which locality?

Either the pm_richraster or pm_occ_cell is wrong.
Both should result in the same richness map, given the same data and resolution, but doesn't happen:
data <- pm_getdata(base_name = "Canis", interval = "Quaternary")
result <- pm_occ_cell(data, rank = "species", res = 10)

shape<- pm_getmap(interval="Quaternary")
richness<- pm_richraster(shape, data, rank="species")

plot(shape)
plot(rasterize(result[, 1:2], richness, rowSums(result[, -(1:2)])),
col = c(adjustcolor("white", 0), mycols(100)), add = T)

I will gonna check on this last issue. My guess is that pm_occ_cell is wrong. I found hard to understand the code, it can be done much easier by using the extract function.

Ok, fixed. I rewrote the function pm_occ_cell. Just pushed last changes.