Coder Social home page Coder Social logo

3dgliomaatlas's People

Contributors

srhilz avatar robertkhu avatar mythichamster avatar

Watchers

 avatar

3dgliomaatlas's Issues

Is the .RData file meant to be part of the Git repos?

I'm not sure whether .RData contain objects necessary to run the Shiny app or not? If not, I guess it needs to be removed from the repos and added to .gitignore.

If it contains objects needed by the app, then, first, .RData should not be used for such purposes. It should be considered for temporary usage between R sessions on the local machine by a single user. Also, when someone else wanna run you app locally, the content of .RData will clutter up their workspace, which is not what people want. (FWIW, I never ever save .RData when I close my session.)

Instead, save the individual objects you need to RDS files to make it explicit what your data are in this repos. Use something like:

saveRDS(mut_413, "mut_413.rds")
saveRDS(mut_485, "mut_485.rds")

and then read them in using:

mut_413 <- readRDS("mut_413.rds")
mut_485 <- saveRDS("mut_485.rds")

Alternatively, put them in an R list and save that:

mutations <- list(mut_413 = mut_413, mut_485 = mut_485)
saveRDS(mutations, "mutations.rds")

and then read them in using:

mutations <- readRDS("mutations.rds")

where you can access the indivual elements as:

mutations[["mut_413"]]
mutations[["mut_485"]]

and so on.

Create an R package

I propose that you create an R package named ThreeDGliomaAtlas that serves your function. The advantage is that all package dependencies will be installed automatically, there is no need for source() in the Shiny app - just a library(ThreeDGliomaAtlas). When there is a first working R package, we can then automatically check it with R CMD check which is an awesome tool for catching current mistakes but also future ones (you can have GitHub Actions to run these check every time you push and you'll be notified if you made a mistake).

The gist is:

  1. Create a DESCRIPTION file that specifies the name of the package, has a short description and that specify all package dependencies that your app needs.

  2. Move your scripts/**/*.R files to R/*.R

  3. Run devtools::install(). Tweak what needs to be tweaked, and repeat.

If you haven't done an R package or struggle, then I can help you. For me, it's pretty straightforward to do but if you want to learn, this is a great opportunity.

When the above is in place, the next step is to also move in the data files into the R package. Hosting data is something R packages do well too. Then, one can move in also the Shiny app into the package. At this point, you will have your Shiny app/artifact fully contained in a single R package. This is where you can consider submitting it to CRAN and have it archived there until the end of time.

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.