AtlasOfLivingAustralia / ALA4R

Access data and resources hosted by the Atlas of Living Australia (ALA)
https://atlasoflivingaustralia.github.io/ALA4R/
42 stars 8 forks source link

occurrences not parsing data correctly when use_data_table is TRUE #2

Closed johnbaums closed 9 years ago

johnbaums commented 9 years ago

occurrences() does not parse data correctly when use_data_table=TRUE. Example below.

x=occurrences(taxon="Chlorophyllum molybdites", download_reason_id=10)
x[[1]][1,]
[1] "5b65daad-4fed-45ff-a70a-5ead010573a2\"\t\"PERTH 8243050\"\t\"08159dd5-b9f7-4758-af64-a40852bd869a\"\t\"Chlorophyllum molybdites (G.Mey.) Massee\"\t\"\"\t\"Chlorophyllum molybdites\"\t\"species\"\t\"False Parasol\"\t\"Fungi\"\t\"Basidiomycota\"\t\"Agaricomycetes\"\t\"Agaricales\"\t\"Agaricaceae\"\t\"Chlorophyllum\"\t\"Chlorophyllum molybdites\"\t\"PERTH\"\t\"PERTH\"\t\"Packsaddle Road, Kununurra\"\t\"-15.85111111\"\t\"128.73305556\"\t\"GDA94\"\t\"-15.85111111\"\t\"128.73305556\"\t\"100.0\"\t\"Australia\"\t\"Victoria Bonaparte\"\t\"\"\t\"Western Australia\"\t\"Wyndham-East Kimberley (S)\"\t\"Byrne, R.\"\t\"2010\"\t\"01\"\t\"2010-01-27\"\t\"PreservedSpecimen\"\t\"PreservedSpecimen\"\t\"\"\t\"el889\"\t\"noIssue\"\t\"true\"\t\"false\"\t\"true\"\t\"true\"\t\"false\"\t\"false\"\t\"false\"\t\"false\"\t\"false\"\t\"false\"\t\"false\"\t\"false\"\t\"false\"\t\"true"

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] data.table_1.9.4 ALA4R_1.066      devtools_1.6.1   jsonlite_0.9.13  httr_0.5        

loaded via a namespace (and not attached):
 [1] assertthat_0.1  chron_2.3-45    digest_0.6.4    grid_3.1.1      lattice_0.20-29 plyr_1.8.1          Rcpp_0.11.3     RCurl_1.95-4.3  reshape2_1.4   
[10] rgdal_0.9-1     sp_1.0-15       stringr_0.6.2   tools_3.1.1    
raymondben commented 9 years ago

Seems to have been a problem with data.table 1.9.3+ failing to detect the correct field separator in the data file. File separator now specified as \t in ALA4R 1.07.

x=occurrences(taxon="Chlorophyllum molybdites", download_reason_id=10)

x$data[1,] id catalogNumber 1 52ac818f-abc8-4535-9dc4-c6d46ae02c23 PERTH 911453 matchTaxonConceptLsid scientificNameOriginal 1 08159dd5-b9f7-4758-af64-a40852bd869a Chlorophyllum molybdites (G.Mey.) Massee commonName scientificName rank kingdom phylum class 1 Chlorophyllum molybdites species Fungi Basidiomycota Agaricomycetes order family genus species institutionCode 1 Agaricales Agaricaceae Chlorophyllum Chlorophyllum molybdites PERTH collectionCode locality latitudeOriginal longitudeOriginal geodeticDatum latitude 1 PERTH Wittenoom -33.46667 122.1333 GDA94 -33.46667 longitude coordinateUncertaintyInMetres country iBRARegion iMCRARegion 1 122.1333 NA Australia Mallee
state localGovernmentArea collector year month eventDate 1 Western Australia Esperance (S) Hall, E. 1982 3 1982-03-03 basisOfRecordOriginal basisOfRecord sex outlierForLayer taxonIdentificationIssue 1 PreservedSpecimen PreservedSpecimen el887 noIssue assumedPresentOccurrenceStatus countryInferredByCoordinates decimalLatLongConverted 1 TRUE FALSE TRUE detectedOutlier firstOfCentury firstOfMonth firstOfYear geodeticDatumAssumedWgs84 1 FALSE FALSE FALSE FALSE FALSE habitatMismatch homonymIssue incompleteCollectionDate invalidCollectionDate 1 FALSE FALSE FALSE FALSE mediaRepresentative nameNotInNationalChecklists 1 FALSE TRUE