I am getting blank when accessing OS environment variable USER from app's server.R installed on shiny server.
output$textoutput=renderText(paste("user name is ",Sys.getenv(c("USER"))))
The variable is available on bash prompt.
I tried exporting the variable as well.
Hi Jasmin, I was trying to recreate your request and it should work based on your mentioned code-snippet.
Best regards
Adam
P.S. Below is a short example:
library(shiny)
ui <- fluidPage(
#display your 'textoutput'
textOutput("textoutput")
)
server <- function(input, output, session){
#get your user name based on 'Sys.getenv' (static object)
user.name <- paste0("user name is ",Sys.getenv(c("USER")))
#test user.name easy by printing on console
print(user.name)
#create UI output object
output$textoutput <- renderText({
user.name
})
}
shinyApp(ui, server)