Combine JS with shiny to view plot produced with fieldImageR in a shiny app environment

53 Views Asked by At

I want to upload a .tif file, in a shiny application, which you can download from here. Then I need to plot it and process it further. But Im not sure how can I display the plot that I see in Rstudio when processing the .tif in a shiny environment . Im curious if this can happen by combining JS and shiny.

library("devtools")
library("sp")
library("raster")
devtools::install_github("filipematias23/FIELDimageR")
library(FIELDimageR)

EX1<-stack("EX1_RGB.tif")
plotRGB(EX1, r = 1, g = 2, b = 3)
EX1.Crop <- fieldCrop(mosaic = EX1) # For heavy images (large, high resolution, etc.) please use: fast.plot=T


## app.R ##  
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
     fileInput(inputId = 'file1',
          label = 'Upload Image',
          placeholder = 'JPEG, PNG, and TIFF are supported',
          accept = c(
            "image/jpeg",
            "image/x-png",
            "image/tiff",
            ".jpg",
            ".png",
            ".tiff"))
  ),
  dashboardBody()
)
options(shiny.maxRequestSize = 100 * 1024 ^ 2) # to acommodate larger images

server <- function(input, output) { }

shinyApp(ui, server)
0

There are 0 best solutions below