Giter Site home page Giter Site logo

rhino-showcase's Introduction

Rhino Showcase - Olympic History Map

This app is built with Rhino. You can see a deployed version here: Rhino Showcase Demo. It is meant to be a showcase of the its features and a place for code/configuration which is not used often enough to be added to the package itself.

Prerequisites

This is an application built in Shiny. To run it, make sure you have R (>= 4.0.0) installed. For JavaScript and Sass development you'll also need Node.js (>= 16.0.0).

Dependencies

Run renv::restore(clean = TRUE) to synchronize the project library with the lockfile when you initially clone the repo or switch branches.

Data

Application-ready data is included in app/data. However, if you want to generate this data from raw sources, run source("./scripts/generate_data.R")

Running

To run the app, use Rscript -e 'shiny::runApp(launch.browser = TRUE)'.

Deployment

You can use the RStudio GUI to deploy the app to RStudio Connect or shinyapps.io. You only need to include the following files: .Rprofile, dependencies.R, app.R, and app/ directory.

Docker

The application can also be packaged as a Docker container using rocker/shiny as a base image.

To build the image locally, execute:

docker build --tag rhino-showcase .

To run the container, execute:

docker run --rm -it -p 3838:3838 rhino-showcase

The application should be available under localhost:3838 on your local workstation.

Development

This project uses renv to manage R package dependencies. To add/remove packages, edit the dependencies.R file and run the following commands:

renv::install() # Install added packages
renv::snapshot() # Update the lockfile
renv::restore(clean = TRUE) # Uninstall removed packages

rhino-showcase's People

Contributors

kamilzyla avatar vikram-rawat avatar vibalre avatar jakubnowicki avatar leszek-sieminski avatar deepanshkhurana avatar micahappsilon avatar magdakunat avatar

Stargazers

 avatar Angel Esteban Feliz avatar Przemysław Marcowski avatar  avatar Nevin Thomas avatar Athan avatar Andrew Allen Bruce avatar Alex Martinez avatar WANG Xin avatar Dereck Mezquita avatar Gabriel Pereira avatar Quentin avatar  avatar  avatar DAR4DS avatar Adrienne Michelson avatar Jimmy Briggs avatar Mayank Agrawal avatar Brent Kaplan avatar Desiree Williams avatar  avatar Bednarz, Agnieszka avatar Juan Patricio Dugo avatar  avatar  avatar  avatar Eduardo dos Santos Almeida avatar

Watchers

Ricardo Rodrigo Basa avatar Pawel Rzymkiewicz avatar Olga Mierzwa-Sulima avatar Filip Stachura avatar marundu avatar  avatar Michał Parkoła avatar Eduardo dos Santos Almeida avatar Janith Wanniarachchi avatar  avatar Pawan Rama Mali avatar  avatar Milos Vilotic avatar Rabii Bouhestine avatar Johan Rosa avatar Marcin Dubel avatar  avatar  avatar

rhino-showcase's Issues

Update R dependencies

Goal

Update all R dependencies in renv.lock to the latest versions. This might raise some issues which will need to be resolved; in particular we know that plotly 4.10.0 changes its JS API and breaks our plots.

Rhino App cannot find package "echarts4r" - eventhough it is installed outside of the project directory

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

No response

Platform and OS Version

openSUSE

Existing Issues

No response

What happened?

I am following the rhino tutorial here: https://appsilon.github.io/rhino/

I have echarts4r installed but when I try to run library(echarts4r) it cannot find the package. The problem only occurs when I create a rhino project.

When I run sessionInfo() outside the rhino directory I can see that the package is installed:

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE Leap 15.4

Matrix products: default
BLAS:   /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] echarts4r_0.4.4 forcats_0.5.2   stringr_1.5.0   dplyr_1.1.0     purrr_1.0.1     readr_2.1.3     tidyr_1.3.0     tibble_3.1.8   
 [9] ggplot2_3.4.0   tidyverse_1.3.2 rvest_1.0.3    

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9          lubridate_1.9.0     assertthat_0.2.1    digest_0.6.31       utf8_1.2.2          mime_0.12          
 [7] R6_2.5.1            cellranger_1.1.0    backports_1.4.1     reprex_2.0.2        httr_1.4.4          pillar_1.8.1       
[13] rlang_1.0.6         googlesheets4_1.0.1 readxl_1.4.1        rstudioapi_0.14     googledrive_2.0.0   htmlwidgets_1.6.1  
[19] bit_4.0.5           munsell_0.5.0       shiny_1.7.4         broom_1.0.2         compiler_4.1.2      httpuv_1.6.8       
[25] modelr_0.1.10       pkgconfig_2.0.3     htmltools_0.5.4     tidyselect_1.2.0    fansi_1.0.4         crayon_1.5.2       
[31] tzdb_0.3.0          dbplyr_2.3.0        withr_2.5.0         later_1.3.0         grid_4.1.2          jsonlite_1.8.4     
[37] xtable_1.8-4        gtable_0.3.1        lifecycle_1.0.3     DBI_1.1.3           magrittr_2.0.3      scales_1.2.1       
[43] cli_3.6.0           stringi_1.7.12      vroom_1.6.0         fs_1.5.2            promises_1.2.0.1    xml2_1.3.3         
[49] ellipsis_0.3.2      generics_0.1.3      vctrs_0.5.2         tools_4.1.2         bit64_4.0.5         glue_1.6.2         
[55] hms_1.1.2           parallel_4.1.2      fastmap_1.1.0       timechange_0.2.0    colorspace_2.1-0    gargle_1.2.1       
[61] haven_2.5.1

When I run the same inside the project:

R version 4.1.2 (2021-11-01)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE Leap 15.4

Matrix products: default
BLAS:   /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

loaded via a namespace (and not attached):
[1] compiler_4.1.2 tools_4.1.2    renv_0.16.0

In the terminal I run:

Outside the project:

matt@localhost:~> whereis R
R: /usr/bin/R /usr/lib64/R /usr/share/R /usr/share/man/man1/R.1.gz

And:

matt@localhost:~> R --version
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-suse-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

Inside the project:

matt@localhost:~/Desktop/rhinoTutorial/rhino> whereis R
R: /usr/bin/R /usr/lib64/R /usr/share/R /usr/share/man/man1/R.1.gz

And

matt@localhost:~/Desktop/rhinoTutorial/rhino> R --version
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-suse-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

Outside project:

> "echarts4r" %in% loadedNamespaces()
[1] TRUE
> file.path(R.home("bin"), "R")
[1] "/usr/lib64/R/bin/R"

Inside project:

> "echarts4r" %in% loadedNamespaces()
[1] FALSE
> file.path(R.home("bin"), "R")
[1] "/usr/lib64/R/bin/R"

I also can't install the package since I get the following error:

> install.packages("echarts4r")
Retrieving 'https://cloud.r-project.org/src/contrib/colorspace_2.1-0.tar.gz' ...
	OK [file is up to date]
Installing tinytex [0.44] ...
	OK [linked cache]
Installing rmarkdown [2.20] ...
	OK [linked cache]
Installing htmlwidgets [1.6.1] ...
	OK [linked cache]
Installing generics [0.1.3] ...
	OK [linked cache]
Installing tidyselect [1.2.0] ...
	OK [linked cache]
Installing dplyr [1.1.0] ...
	OK [linked cache]
Installing countrycode [1.4.0] ...
	OK [linked cache]
Installing cpp11 [0.4.3] ...
	OK [linked cache]
Installing tidyr [1.3.0] ...
	OK [linked cache]
Installing broom [1.0.3] ...
	OK [linked cache]
Installing farver [2.1.1] ...
	OK [linked cache]
Installing labeling [0.4.2] ...
	OK [linked cache]
Installing colorspace [2.1-0] ...
	FAILED
Error installing package 'colorspace':
======================================

* installing *source* package ‘colorspace’ ...
** package ‘colorspace’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/usr/lib64/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g  -c colorspace.c -o colorspace.o
gcc -I"/usr/lib64/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g  -c init.c -o init.o
gcc -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o colorspace.so colorspace.o init.o -L/usr/lib64/R/lib -lR
installing to /home/matt/Desktop/rhinoTutorial/rhino/renv/staging/1/00LOCK-colorspace/00new/colorspace/libs
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** byte-compile and prepare package for lazy loading
Error in namespaceExport(ns, exports) : 
  undefined exports: walkCode, makeCodeWalker, showTree, makeConstantFolder, constantFold, isConstantValue, getAssignedVar, makeLocalsCollector, collectLocals, findLocals, findLocalsList, findFuncLocals, flattenAssignment, makeUsageCollector, collectUsage, findGlobals, checkUsage, checkUsageEnv, checkUsagePackage
Error: unable to load R code in package ‘colorspace’
Execution halted
ERROR: lazy loading failed for package ‘colorspace’
* removing ‘/home/matt/Desktop/rhinoTutorial/rhino/renv/staging/1/colorspace’
Error: install of package 'colorspace' failed [error code 1]

Steps to reproduce

...

Expected behavior

Use the correct package/r version

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

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.