necessary to install R taxonomic packages for shinyapp?
emilio-berti opened this issue · comments
When I try to launch the shiny app I got the following error:
> source("server.R")
✔ Updated metadata database: 2.46 MB in 6 files.
✔ Updating metadata database ... done
Error: Cannot install packages:
* sckott/splister: Bad GitHub credentials, make sure that your GitHub token is valid.
* ropensci/taxizedb: Bad GitHub credentials, make sure that your GitHub token is valid.
* helixcn/plantlist: Bad GitHub credentials, make sure that your GitHub token is valid.
* traitecoevo/taxonlookup: Bad GitHub credentials, make sure that your GitHub token is valid.
* joelnitta/taxastand: Bad GitHub credentials, make sure that your GitHub token is valid.
* EDIorg/taxonomyCleanr: Bad GitHub credentials, make sure that your GitHub token is valid.
* idiv-biodiversity/lcvplants: Bad GitHub credentials, make sure that your GitHub token is valid.
* gustavobio/tpl: Bad GitHub credentials, make sure that your GitHub token is valid.
* sckott/taxspell: Bad GitHub credentials, make sure that your GitHub token is valid.
* gustavobio/tpldata: Bad GitHub credentials, make sure that your GitHu
I know how to fix this, I just wanted to know if it's necessary to install all these packages for the purpose of the shiny app.
Emilio
Just a suggestion here: dependency can be obtained from CRAN using python relatively easy. Save the following script as get-deps.py:
import sys
import pandas as pd
pkg_name = sys.argv[1]
print(pkg_name)
url = 'https://cran.r-project.org/web/packages/' + pkg_name + '/index.html'
print(url)
pkg = pd.read_html(url)[0]
imports = pkg[pkg[0] == 'Imports:'][1][2].replace(' ', '').split(',')
file = open(pkg_name + '.txt','w')
for x in imports:
file.writelines(x)
file.writelines('\n')
file.close()
This can be called with (e.g. with taxadb) python3 get-deps.py taxadb
, which write the file taxadb.txt containing:
dplyr
DBI
arkdb(>0.0.10)
tibble
memoise
readr
rappdirs
rlang
magrittr
stringi
progress
utils
dbplyr
RSQLite
curl
jsonlite
duckdb
contentid
Depending on how we will store the app, but this is probably much lighter. Users need python, though.
The error is really weird, because the shiny app only loads the data from an RData file and doesn't actually perform the dependency search.
- Did you pull the last version of the repository before launching the shiny app?
- How do you launch the shiny app? Because
source('server.R')
doesn't launch it. You should runshiny::runApp("taxharmonizexplorer")
and see.
Okay problem solved by pulling last version and running shiny::runApp("taxharmonizexplorer")
.
Also fixes #6