diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 83f12fd..67f3619 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -56,6 +56,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xvfb \ tzdata \ sudo\ + gsfonts-x11\ jq\ curl\ libgit2-dev \ diff --git a/R/.Rprofile b/R/.Rprofile index c044f24..75a2e39 100644 --- a/R/.Rprofile +++ b/R/.Rprofile @@ -1 +1,28 @@ -source("renv/activate.R") +# source("renv/activate.R") + +# Source: https://renkun.me/2020/04/14/writing-r-in-vscode-working-with-multiple-r-sessions/ +Sys.setenv(TERM_PROGRAM = "vscode") +source(file.path(Sys.getenv( + if (.Platform$OS.type == "windows") "USERPROFILE" else "HOME"), + ".vscode-R", "init.R") +) + +# Source: https://github.com/REditorSupport/vscode-R/wiki/Plot-viewer#svg-in-httpgd-webpage +if (interactive() && Sys.getenv("TERM_PROGRAM") == "vscode") { + if ("httpgd" %in% .packages(all.available = TRUE)) { + options(vsc.plot = FALSE) + options(device = function(...) { + httpgd::hgd(silent = TRUE) + .vsc.browser(httpgd::hgd_url(history = FALSE), viewer = "Beside") + }) + } +} + +# Set CRAN Mirror +options(repos = Sys.getenv("CRAN_MIRROR")) +options(repos = Sys.getenv("https://cran.rstudio.com/")) + +local({r <- getOption("repos") + r["CRAN"] <- Sys.getenv("CRAN_MIRROR") + options(repos=r) +}) \ No newline at end of file diff --git a/R/.cache.sqlite b/R/.cache.sqlite new file mode 100644 index 0000000..4e5b2ab Binary files /dev/null and b/R/.cache.sqlite differ diff --git a/R/.gitignore b/R/.gitignore new file mode 100644 index 0000000..075b254 --- /dev/null +++ b/R/.gitignore @@ -0,0 +1 @@ +/.quarto/ diff --git a/R/Wind-Energy-Yield-Forecast.qmd b/R/Wind-Energy-Yield-Forecast.qmd index 77fe787..02914a5 100644 --- a/R/Wind-Energy-Yield-Forecast.qmd +++ b/R/Wind-Energy-Yield-Forecast.qmd @@ -33,20 +33,41 @@ Wind power and on-site energy forecast for **one Goldwind turbine model GW 165-6 # ========================== Load Dependencies ========================== -library(reticulate) -library(dplyr) -library(lubridate) -library(ggplot2) -# library(plotly) -# library(patchwork) -library(kableExtra) -library(xts) +# 1.1. Used Libraries: + +my_packages <- c("reticulate", + "ggplot2", # graphical library + "dplyr", + "tibble", + "kableExtra", + "lubridate", + "xts" + ) + +# "pals" # more colour palettes +# "ggthemes" # more colour palettes + +# 1.2. Install packages --------------------- + +my_installed_packages <- my_packages %in% rownames(installed.packages()) + +if (any(my_installed_packages == FALSE)) install.packages(my_packages[!my_installed_packages]) + +# 1.3. Load Packages ---------------------- + +invisible(lapply(my_packages, library, character.only = TRUE)) + +remove("my_packages", "my_installed_packages") source("./jthomfuncs.r") theme_set(jthomggtheme) source("./jthomfuncs_wind.r") + + + + ``` @@ -122,7 +143,7 @@ Site and turbine model #| echo: false hourly_df <- py$hourly_dataframe -save(hourly_df, file = "./data/last_update_weather.Rdata") +save(hourly_df, file = "../data/last_update_weather.Rdata") #load("./data/last_update_weather.Rdata") diff --git a/data/last_update_weather.Rdata b/data/last_update_weather.Rdata index 3396a8a..b2ce687 100644 Binary files a/data/last_update_weather.Rdata and b/data/last_update_weather.Rdata differ