Skip to content

Commit

Permalink
gsfonts-x11 package added to Ubuntu installation in Dockerfile. Rprof…
Browse files Browse the repository at this point in the history
…ile changed to avoid renv (not in use in the container)
  • Loading branch information
jorgethomasm committed Jul 16, 2024
1 parent 13b21d4 commit 33683cd
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 10 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xvfb \
tzdata \
sudo\
gsfonts-x11\
jq\
curl\
libgit2-dev \
Expand Down
29 changes: 28 additions & 1 deletion R/.Rprofile
Original file line number Diff line number Diff line change
@@ -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)
})
Binary file added R/.cache.sqlite
Binary file not shown.
1 change: 1 addition & 0 deletions R/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.quarto/
39 changes: 30 additions & 9 deletions R/Wind-Energy-Yield-Forecast.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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")
```


Expand Down Expand Up @@ -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")
Expand Down
Binary file modified data/last_update_weather.Rdata
Binary file not shown.

0 comments on commit 33683cd

Please sign in to comment.