Closed herisonmedeiros closed 3 years ago
Dear @herisonmedeiros, thanks for posting this issue and sorry for the delay in finding the solution.
The error you mentioned was related to the the difference in the number of columns that speciesLink returns for queries using different taxa. Since your example used a very small genera, some essential columns for the merge were not returned from speciesLink ("monthIdentified", "dayIdentified"). This was a possibility the we have not foreseen. The problem should be solved with the last commit but you will need to re-install the package.
Please not as well that the need to declare the authorship of the genus in the
argument species
of rgbif2 is not always true. This was the case because of
the presence of homonyms in the GBIF taxonomic backbone: Lophostigma Radlk.,
Lophostigma Engl. & Prantl. (both Spaindaceae) and Lophostigma Mickel
(Arthropoda). I tried using the function to make a query at genus level for
another genera without the authorship (Paubrasilia) and the functions worked as
expected.
I used the code below, which worked as expected in my machine:
# Downloading the data
occs_splink <- rspeciesLink(species = "Lophostigma",
basisOfRecord = 'PreservedSpecimen')
occs_gbif <- rgbif2(species = "Lophostigma Radlk.", force = TRUE)
# Combining the data
occs <- formatDwc(splink_data = occs_splink,
gbif_data = occs_gbif, drop = TRUE)
Please let us know if you still run into errors or not so that we can close this issue.
The formatDwc() function either for data downloaded directly with the PlantR script or for data downloaded directly from Gbif and Species_link encountered the following error
occs_splink <- rspeciesLink(filename = "Lophostigma_teste_splink.txt", save = TRUE, basisOfRecord = 'PreservedSpecimen', species = "Lophostigma") occs_gbif <- rgbif2(filename = "Lophostigma_teste_gbif.txt", species = "Lophostigma Radlk.", n.records = 110000, force = TRUE, save = TRUE) occs <- formatDwc(splink_data = occs_splink, gbif_data = occs_gbif, drop = TRUE) Error in
[.data.frame
(splink_data, , c("yearIdentified", "monthIdentified", : undefined columns selected In addition: Warning message: some columns in splink_data do not follow the speciesLink pattern