Alliance-for-Tropical-Forest-Science / DataHarmonization

Code to run the data harmonization app and support cross-site analysis
https://alliance-for-tropical-forest-science.github.io/DataHarmonization/
3 stars 1 forks source link

runGithub #45

Closed gabrielareto closed 1 year ago

gabrielareto commented 1 year ago

is there any alternative to "shiny::runGithub"? Sometimes we cannot launch the app because timeouts and things like that. Once the package is installed, Shouldn't we be able to run the app without internet connection? Completely locally.

the online version is not being used very often in the ForestGEO workshop in Panama.

ValentineHerr commented 1 year ago

Good point.

I added a run_app to the package. so now, after isntalling it, the user should be able to run:

DataHarmonization::run_app()

and the app should run locally.

Can you try it @gabrielareto?

gabrielareto commented 1 year ago

DataHarmonization::run_app() Error: 'run_app' is not an exported object from 'namespace:DataHarmonization'

ValentineHerr commented 1 year ago

did you re-install the package to get the latest version?

devtools::install_github("Alliance-for-Tropical-Forest-Science/DataHarmonization", build_vignettes = TRUE)

gabrielareto commented 1 year ago

yes, with force = TRUE. Same error.

ValentineHerr commented 1 year ago

After restarting a session, this worked for me. Can you try again?

devtools::install_github("Alliance-for-Tropical-Forest-Science/DataHarmonization", build_vignettes = TRUE)
library(DataHarmonization)
library(shiny)
DataHarmonization::run_app()
gabrielareto commented 1 year ago

devtools::install_github("Alliance-for-Tropical-Forest-Science/DataHarmonization", build_vignettes = TRUE) Downloading GitHub repo Alliance-for-Tropical-Forest-Science/DataHarmonization@HEAD ── R CMD build ──────────────────────────────────────────────────────────────────────── ✔ checking for file ‘/private/var/folders/vx/k98504j95hsbr_vym28v2t7w0000gn/T/RtmpDkOJhu/remotesc66ea22d390/Alliance-for-Tropical-Forest-Science-DataHarmonization-8c36ae7/DESCRIPTION’ ... ─ preparing ‘DataHarmonization’: ✔ checking DESCRIPTION meta-information ... ─ installing the package to build vignettes ✔ creating vignettes (11.8s) ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘DataHarmonization_0.0.0.9000.tar.gz’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/setup_e2f8182b76baf87832dd16843283fe92.RData’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-2_b44be9ca9520d443a1bdcb94ffca734f.RData’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-2_b44be9ca9520d443a1bdcb94ffca734f.rdb’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-2_b44be9ca9520d443a1bdcb94ffca734f.rdx’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-3_af0e886682b7864f75ae7e3ea4b594fc.RData’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-3_af0e886682b7864f75ae7e3ea4b594fc.rdb’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-3_af0e886682b7864f75ae7e3ea4b594fc.rdx’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-4_a5f6f6bea81e1cd0462e3dfce6790806.RData’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-4_a5f6f6bea81e1cd0462e3dfce6790806.rdb’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-4_a5f6f6bea81e1cd0462e3dfce6790806.rdx’

ValentineHerr commented 1 year ago

strange

gabrielareto commented 1 year ago

I re-installed R and RStudio. A different problem now:

devtools::install_github("Alliance-for-Tropical-Forest-Science/DataHarmonization", build_vignettes = TRUE, force = TRUE) Downloading GitHub repo Alliance-for-Tropical-Forest-Science/DataHarmonization@HEAD These packages have more recent versions available. It is recommended to update all of them. Which would you like to update?

1: All
2: CRAN packages only
3: None
4: bslib (0.5.0 -> 0.5.1) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1 bslib (0.5.0 -> 0.5.1) [CRAN] Installing 1 packages: bslib trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-x86_64/contrib/4.3/bslib_0.5.0.tgz' Content type 'application/x-gzip' length 5013089 bytes (4.8 MB)

downloaded 4.8 MB

The downloaded binary packages are in /var/folders/vx/k98504j95hsbr_vym28v2t7w0000gn/T//RtmpG8ofr6/downloaded_packages ── R CMD build ────────────────────────────────────────────────────────────────── ✔ checking for file ‘/private/var/folders/vx/k98504j95hsbr_vym28v2t7w0000gn/T/RtmpG8ofr6/remotes14b2d669b9ed4/Alliance-for-Tropical-Forest-Science-DataHarmonization-8c36ae7/DESCRIPTION’ ... ─ preparing ‘DataHarmonization’: (418ms) ✔ checking DESCRIPTION meta-information ... ─ installing the package to build vignettes ✔ creating vignettes (12.1s) ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘DataHarmonization_0.0.0.9000.tar.gz’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/setup_0fe4c4a1f1b4e41096322f8086d470a3.RData’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-2_e28bb78654b2e99912f7fadb6e406139.RData’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-2_e28bb78654b2e99912f7fadb6e406139.rdb’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-2_e28bb78654b2e99912f7fadb6e406139.rdx’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-3_0f3b0b996d8c60f7787bf3c848d4b6f6.RData’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-3_0f3b0b996d8c60f7787bf3c848d4b6f6.rdb’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-3_0f3b0b996d8c60f7787bf3c848d4b6f6.rdx’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-4_6ac260df89ce7225ee91aced7d3400e8.RData’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-4_6ac260df89ce7225ee91aced7d3400e8.rdb’ Warning in utils::tar(filepath, pkgname, compression = compression, compression_level = 9L, : storing paths of more than 100 bytes is not portable: ‘DataHarmonization/vignettes/DataHarmonization_cache/html/unnamed-chunk-4_6ac260df89ce7225ee91aced7d3400e8.rdx’

gabrielareto commented 1 year ago

after installing again (devtools::install_github("Alliance-for-Tropical-Forest-Science/DataHarmonization", build_vignettes = TRUE, force = TRUE)) and updating all packages, these are the errors I get:

library(DataHarmonization) library(shiny) Error in value[3L] : Package ‘shiny’ version 1.7.4.1 cannot be unloaded: Error in unloadNamespace(package) : namespace ‘shiny’ is imported by ‘miniUI’, ‘DataHarmonization’ so cannot be unloaded DataHarmonization::run_app() Loading required package: shiny Failed with error: ‘Package ‘shiny’ version 1.7.4.1 cannot be unloaded: Error in unloadNamespace(package) : namespace ‘shiny’ is imported by ‘miniUI’, ‘DataHarmonization’ so cannot be unloaded ’ Error in shinyAppDir(): ! No Shiny application exists at the path "app" Run rlang::last_trace() to see where the error occurred. rlang::last_trace() <error/invalidShinyAppDir> Error in shinyAppDir(): ! No Shiny application exists at the path "app"

Backtrace: ▆

  1. └─DataHarmonization::run_app()
  2. └─shiny::runApp("app")
  3. ├─shiny::as.shiny.appobj(appDir)
  4. └─shiny:::as.shiny.appobj.character(appDir)
  5. └─shiny::shinyAppDir(x) Run rlang::last_trace(drop = FALSE) to see 1 hidden frame.
ValentineHerr commented 1 year ago

this should work now, can you check @gabrielareto ?

gabrielareto commented 1 year ago

Yes, it works! Now I understand... the string "app" was not enough to locate the local directory with the app, in contrast with the remote execution that we had before.

Thanks!