LimaRAF / plantR

An R Package for Managing Species Records from Biological Collections
GNU General Public License v3.0
18 stars 4 forks source link

Error in formatTax() #96

Closed ggrittz closed 1 year ago

ggrittz commented 2 years ago

Opa,

Segue abaixo o erro que tou recebendo no formatTax()

occs <- readData(file = "0428744-210914110416597.zip",
                 path <- "https://api.gbif.org/v1/occurrence/download/request/",
                 output = 'occurrence') [usando apenas o output = occurrence por conta do que comentei na outra thread]

#DwC file: format field names for following formatatting
occs <- formatDwc(gbif_data = occs)
#Format collection codes, people names, collector number, and dates
occs <- formatOcc(occs)
#Standardize locality info (country, city names)
occs <- formatLoc(occs)
#Geographical coordinates: decimal degrees formatting and retrieves missing coordinates
#from a gazetteer
occs <- formatCoord(occs)
#Format species and family names
occs <- formatTax(occs)

Retorna o seguinte (abaixo diz que os nomes das famílias foram substituídos mas imagino que o erro impeça, pois depois chequei e não foram):

|++++++++++++++++++++++++++++++++++++++++++++++++++| 100%
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100%
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100%
The following family names were automatically replaced:

|Genus          |Old fam.         |New fam.         |
|:--------------|:----------------|:----------------|
|Cordia         |Cordiaceae       |Boraginaceae     |
|Cunninghamia   |Cupressaceae     |Rubiaceae        |
|Dombeya        |Malvaceae        |Araucariaceae    |
|Ehretia        |Ehretiaceae      |Boraginaceae     |
|Euploca        |Heliotropiaceae  |Boraginaceae     |
|Heisteria      |Erythropalaceae  |Olacaceae        |
|Heliotropium   |Heliotropiaceae  |Boraginaceae     |
|Hydrocotyle    |Apiaceae         |Araliaceae       |
|Lonicera       |Caprifoliaceae   |Rubiaceae        |
|Matourea       |Plantaginaceae   |Scrophulariaceae |
|Myriopus       |Heliotropiaceae  |Boraginaceae     |
|Nephrolepis    |Nephrolepidaceae |Lomariopsidaceae |
|Piriqueta      |Turneraceae      |Turneraceae      |
|Prosopanche    |Hydnoraceae      |Hydnoraceae      |
|Quiina         |Quiinaceae       |Quiinaceae       |
|Sambucus       |Adoxaceae        |Adoxaceae        |
|Tetrastylidium |Strombosiaceae   |Olacaceae        |
|Tournefortia   |Heliotropiaceae  |Boraginaceae     |
|Turnera        |Turneraceae      |Turneraceae      |
|Varronia       |Cordiaceae       |Boraginaceae     |
|Viburnum       |Adoxaceae        |Adoxaceae        |
|Viviania       |Vivianiaceae     |Vivianiaceae     |
|Ximenia        |Ximeniaceae      |Olacaceae        |

Error in `[.data.table`(families.data, is.na(name.correct), tmp.fam, FALSE) : 
  The items in the 'by' or 'keyby' list are length(s) (1). Each must be length 10; the same length as there are rows in x (after subsetting if i is provided).
In addition: Warning messages:
1: In gsub(paste0(" ", rank, " "), paste0(" ", rank), x_new, perl = TRUE) :
  argument 'pattern' has length > 1 and only the first element will be used
2: In gsub(paste0(" ", rank, " "), paste0(" ", rank), x_new, perl = TRUE) :
  argument 'replacement' has length > 1 and only the first element will be used

Tou no {plantR} 0.1.5 e no R 4.2.1.

Abs!

LimaRAF commented 1 year ago

Dear @ggrittz,

This is a remaining issue related to the superseeding of the Plant List website, and therefore of the TPL R package. I have muted the TPL-related code. Should be fine by now after the commit, but I still need to include a more international option of validating species names.