🐛 fixed the credentials bug for documentation
This commit is contained in:
23
src/main.Rmd
23
src/main.Rmd
@@ -10,7 +10,7 @@ date: "`r Sys.Date()`"
|
||||
knitr::opts_chunk$set(echo = TRUE)
|
||||
```
|
||||
|
||||
```{r preamble, message=FALSE}
|
||||
```{r preamble, message=FALSE, include=FALSE}
|
||||
# Load Libraries
|
||||
library(dplyr)
|
||||
library(lubridate)
|
||||
@@ -24,8 +24,8 @@ library(trajr)
|
||||
library(shiny)
|
||||
```
|
||||
|
||||
# Openskies API Functions
|
||||
```{r opensky, include=FALSE}
|
||||
# Openskies API Functions
|
||||
|
||||
time_now <- Sys.time()
|
||||
creds <- getCredentials(
|
||||
@@ -52,8 +52,9 @@ getAircraftTrack <- function(icao, time, creds) {
|
||||
}
|
||||
```
|
||||
|
||||
## Trajectory Conversion Functions
|
||||
```{r trajectory-functions, include=FALSE}
|
||||
# Trajectory Conversion Functions
|
||||
|
||||
# Convert route to distance in meters
|
||||
getRouteDistance <- function(route_df) {
|
||||
lat_ref <- route_df$lat[1]
|
||||
@@ -165,8 +166,9 @@ calculate_trajectory_params <- function(icao, departure_time, creds) {
|
||||
}
|
||||
```
|
||||
|
||||
## Statistical Helper Functions
|
||||
```{r stat-functions, include=FALSE}
|
||||
# Statistical Helper Functions
|
||||
|
||||
# Get parameter names and labels for trajectory statistics
|
||||
getTrajectoryParams <- function() {
|
||||
list(
|
||||
@@ -202,8 +204,9 @@ calculateStatsSummary <- function(trajectory_stats_df) {
|
||||
}
|
||||
```
|
||||
|
||||
## Visualization Functions
|
||||
```{r viz-functions, include=FALSE}
|
||||
# Visualization Functions
|
||||
|
||||
# Create boxplots for trajectory statistics
|
||||
createBoxplots <- function(trajectory_stats_df) {
|
||||
p <- getTrajectoryParams()
|
||||
@@ -313,10 +316,12 @@ This section demonstrates how to use all functions defined above. Each step is e
|
||||
|
||||
The `getCredentials()` function loads API credentials from environment variables.
|
||||
|
||||
```{r demo-credentials}
|
||||
creds <- getCredentials()
|
||||
has_creds <- nzchar(creds$client_id) && nzchar(creds$client_secret)
|
||||
cat("Credentials loaded:", has_creds, "\n")
|
||||
```r
|
||||
creds <- getCredentials(
|
||||
client_id = Sys.getenv("OPENSKY_CLIENT_ID"),
|
||||
client_secret = Sys.getenv("OPENSKY_CLIENT_SECRET")
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
## Step 2: Fetch Airport Departures
|
||||
|
||||
Reference in New Issue
Block a user