Giter Site home page Giter Site logo

liibre / rocc Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 5.0 664 KB

Get species occurrence data from speciesLink and GBIF, and species lists from the Brazilian Flora 2020. Perform basic taxonomic checks based on Brazilian Flora 2020. Download GADM, WDPA and DIVA-GIS gazetteer shapefiles.

Home Page: https://liibre.github.io/Rocc/

R 100.00%
specieslink brazilian-biodiversity gadm wdpa gbif brazil-flora darwin-core

rocc's Introduction

Rocc package: management and analysis of species occurrence data

Installing and loading the package

devtools::install_github("liibre/Rocc")
library(Rocc)

Downloading and binding occurrence data from R

  • rspeciesLink() downloads occurrences directly from speciesLink API

  • rgbif2() downloads occurrences from GBIF, a wrapper function of rgbif() in the package rgbif

  • bind_dwc() formats an output of occurrence data based on the current DarwinCore standard and bind data from the different sources such as GBIF and speciesLink

Basic taxonomic cleaning

  • check_string() identifies open nomenclature, infraspecies categories, authorship, undetermined species, hybrid species, non-ascii characters in species name, digits in species name. Performs a check in the given name and returns a flag of the status and a string correction. For taxonomic check see suggest_flora() and check_flora()

  • suggest_flora() trims and corrects typo of a given species name

  • check_flora() makes a request to Brazilian Flora 2020 API and returns accepted name and synonyms

Direct query to Brazilian Flora 2020 database

  • search_flora() searches in the List of Species of the Brazilian Flora 2020 database (by endemism, life form, habitat or vegetation type)

  • update_flora() downloads, updates and formats the data from the ipt server of the List of Species of the Brazilian Flora

Additional functions

Examples

For more details, see Articles section.

rocc's People

Contributors

andreasancheztapia avatar rhodnius avatar saramortara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rocc's Issues

Change to how `save` argument works on `rspeciesLink()`

Oi pessoal,

Eu estava fazendo algumas buscas e acabei pensando que o funcionamento do argumento save (que é TRUE por padrão) pode trazer alguns problemas indesejados.
Eu entendo que é importante salvar os resultados da busca em um arquivo na pasta de trabalho, mas se eu fizer outra busca logo em seguida, a função salva o arquivo output por cima do outro, já que, por padrão, ele se chama "output".

Se a busca anterior tiver sido bem grande, vai sobrepor o arquivo anterior sem nenhum aviso.
Talvez a função file.exists() possa ajudar nisso.

Obrigado!!

Premature End of File when requesting data

Hi, thank you for developing this nice package! I am trying to download all occurrences of fish species (but as there is no specific category, I am using Scope = "animals"). The request starts, but at some point I get the error:
"Error in parse_con(txt, bigint_as_char) : parse error: premature EOF"

Would you know how can I solve this problem?

Here is the code snippet:

animals_link <- rspeciesLink(filename = "animals_speciesLink_occurrence",
                     Scope = "animals",
                     basisOfRecord = "PreservedSpecimen") 

More data variables from specieslink

Oi pessoal, tudo bem mandar em PT-BR?

Gostaria de ver com vocês se é possível adicionar as outras variáveis disponíveis no specieslink, como as Notas e outras que podem conter informações relevantes e podem acabar passando despercebidas.
Pode ser também que esses dados já seja puxados mas eu que não esteja vendo. Dei uma olhada no código e acho que não puxa alguns desses argumentos.

Desculpa por criar essa demanda, é só porque quero incentivar o pessoal a buscar pelo R (porque é muito mais eficiente ver a tabela pronta e tal), mas podem faltar alguns dados.

Obrigado!!

FB2020 API out of service?

Olá Andrea e Sara,

estou tentando usar a função check_flora() do pacote Rocc de vocês... tá retornando o erro "Flora 2020 API is out of service"...

Fui lá no seu código da função e testei a parte que interage com o API usando um exemplo abaixo:

api <- "http://servicos.jbrj.gov.br/flora/taxon/"
jsonlite::fromJSON(paste0(api, "Caesalpinia"))

e então retornou este erro abaixo>

Error in parse_con(txt, bigint_as_char) : parse error: trailing garbage
] } ] }Conectado com: 10.10.100.29<br/
(right here) ------^

Poderia me ajudar a resolver isso??? De fato, quando eu busco no navegador por "http://servicos.jbrj.gov.br/flora/taxon/Caesalpinia", eu consigo ver o texto lá completo. Então o API parece estar funcionando, não???

Grato pela atenção!

Domingos Cardoso

Error: Tibble columns must have compatible sizes.

Hello,
I've searched for my error in the issues tab but found nothing. So here it goes:

I am following the article: Basic workflow using Rocc to learn Rocc's commands and I got an error when trying to convert the data_gbif list of tables to a data frame.
The species link list conversion to data frame ran fine, however the gbif list stopped due to this:

image

Could you help me?
species_search.txt

Thank you in advance,

Peter

unable to runrspeciesLink()

Making request to speciesLink...
Error in open.connection(con, "rb") : HTTP error 400.

Show traceback:

open.connection(con, "rb")
6.
open(con, "rb")
5.
parse_con(txt, bigint_as_char)
4.
parseJSON(txt, bigint_as_char)
3.
parse_and_simplify(txt = txt, simplifyVector = simplifyVector,
simplifyDataFrame = simplifyDataFrame, simplifyMatrix = simplifyMatrix,
flatten = flatten, ...)
2.
jsonlite::fromJSON(my_url)
1.
rspeciesLink(filename = paste0("raw_data_SpeciesLink_", scientificName[a]),
scientificName = scientificName[a], Coordinates = "Yes")

I have newest version of the function and also have unistalled and reinstalled R and RStudio in my computer. It's been weeks since this error is showing.

Check error messages in check_flora()

Estou passando check_flora() para um vetor de muitos nomes, usando purrr::map() (deveria paralelizar mas fiquei pensando se API não reclama). Para alguns nomes recebo:

Error in data.frame(..., check.names = FALSE)  
  arguments imply differing number of rows: 1, 0

Suponho que é em alguma junção interna e vou procurar, mas deixo aqui caso vc tenha visto e para fechar quando resolver.

RSpeciesLink por municipio não está funcionando

O exemplo do article:

ex04 <- rspeciesLink(filename = "ex04",
                     Scope = "plants", 
                     basisOfRecord = "PreservedSpecimen",
                     county = "Mariana", 
                     stateProvince = c("Minas Gerais", "MG"),
                     country = c("Brazil", "Brasil"),
                     RedList = TRUE,
                     MaxRecords = 100)

está escrevendo arquivos vazios:


"x"
"results/"

Ainda não olhei passo a passo o ponto que dá problema, mas deixo anotado aqui caso você tenha mais noção.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.