diff --git a/R/edudat/R/edudat.R b/R/edudat/R/edudat.R index 1c052ea..cd49099 100644 --- a/R/edudat/R/edudat.R +++ b/R/edudat/R/edudat.R @@ -104,7 +104,7 @@ load_data <- function(name, verbose = FALSE, show_code = FALSE) { #' Load the Quarto documentation file from repository and cache it locally #' -#' @param name Name of the Quarto file (e.g., "challenger.qmd") +#' @param name Name of the Quarto file (e.g., "challenger.qmd" or "test.csv.gz") #' @param verbose Logical indicating whether to print messages #' @return The path to the cached Quarto file #' @export @@ -152,13 +152,48 @@ list_cache_files <- function() { } ### misc functions #### -#' Shows the URL of the package on GitHub -#' -#' @export -show_url <- function() { - message("") +show_mini_help <- function() { + # Define the URL and the display text + html_content <- " + +
+ +
+
+ df <- edudat::load_data('challenger.csv')
+ plot_data(df)
+
+
+
+ Info:
+
+
+ edudat::list_cache_files()
+
+
+
+ For more see:
+ github.com/tensorchiefs/data/
+
+
+ "
+
+ # Write the HTML content to a temporary file
+ temp_file <- tempfile(fileext = ".html")
+ writeLines(html_content, temp_file)
+
+ # Open the HTML file in the Viewer pane
+ rstudioapi::viewer(temp_file)
}
+# Example usage of the show_mini_help function
+show_mini_help()
+
+
+
diff --git a/data/test.qmd b/data/test.qmd
index 5b65c47..2d0093b 100644
--- a/data/test.qmd
+++ b/data/test.qmd
@@ -13,7 +13,17 @@ https://homafiles.info/2016/06/06/the-challenger-disaster-a-tragic-lesson-in-dat
## Plotting in R
-```{r plot_data, echo=TRUE, eval=TRUE}
+```{r plot_data_old, echo=TRUE, eval=TRUE}
+data <- read.csv("https://raw.githubusercontent.com/tensorchiefs/data/main/data/challenger.csv", stringsAsFactors = FALSE)
+library(ggplot2)
+ggplot(data, aes(x = Temp, y = Failure)) +
+ geom_point() +
+ xlab("Temperature (F)") +
+ ggtitle("Challenger O-Ring Data")
+```
+
+
+```{r plot_data, echo=TRUE, eval=FALSE}
data <- read.csv("https://raw.githubusercontent.com/tensorchiefs/data/main/data/challenger.csv", stringsAsFactors = FALSE)
library(ggplot2)
ggplot(data, aes(x = Temp, y = Failure)) +
diff --git a/python/main.yml b/python/main.yml
index 4dedab5..a06aecc 100644
--- a/python/main.yml
+++ b/python/main.yml
@@ -11,7 +11,8 @@ on:
jobs:
render:
runs-on: ubuntu-latest
-
+ env:
+ GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
@@ -22,22 +23,13 @@ jobs:
- name: Install R
uses: r-lib/actions/setup-r@v2
- - name: Install R packages
- run: |
- Rscript -e 'install.packages(c("ggplot2", "knitr", "rmarkdown", "remotes"))'
- # Rscript -e 'remotes::install_github("tensorchiefs/data", subdir = "R/edudat", dependencies = TRUE, upgrade = "always", verbose = TRUE)'
+ #- name: Install R packages
+ # run: |
+ # Rscript -e 'install.packages(c("ggplot2"))'
+ #Rscript -e 'remotes::install_github("tensorchiefs/data", subdir = "R/edudat", auth_token = Sys.getenv("GITHUB_PAT"), dependencies = TRUE, upgrade = "always", verbose = TRUE)'
- - name: Install Python packages
- run: |
- pip install pandas matplotlib
-
- - name: Render all Quarto documents
- env:
- GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
+ - name: Render test.qmd document
run: |
- #for qmd in data/*.1qmd; do
- # quarto render "$qmd" --to html
- #done
quarto render data/test.qmd --to html
- name: Deploy to GitHub Pages