Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

Passing environmental variables to shinyapps.io

$
0
0

I'm trying to publish a Shiny app to shinyapps.io but the app requires a Quandl API connection. I don't want to put the API key in my code so I use a .Renviron file to store the API key.

This is the content of the .Renviron file:

QUANDL_API_KEY=api_key_goes_here

This is the content of the .Rmd file:

---
title: "Test"
runtime: shiny
output: html_document
---

```{r}
print(Sys.getenv("QUANDL_API_KEY"))
```

When I deploy to shinyapps.io nothing is printed out. But when I run locally, the key is printed. The .Renviron file is in the app root directory.

What am I doing wrong?


Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>