This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(openxlsx2) | |
packageVersion("openxlsx2") | |
# the dimensions go in here | |
dim_matrix <- matrix("", 20, 10) | |
# matrix of size 2 x 2 | |
mm <- matrix(1:4, 2, 2) | |
dim_matrix[1, 1] <- wb_dims(x = mm, col_names = FALSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url <- "https://www.garbuszus.de/marvin/wahlumfragen_raw.csv" | |
dat <- read.csv2(url) | |
dat$date <- as.Date(dat$date) | |
nms <- names(dat) | |
nms[nms == "CDU.CSU"] <- "CDU/CSU" | |
names(dat) <- nms | |
library(openxlsx2) | |
wb <- wb_workbook()$ | |
add_chartsheet("chart")$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(openxlsx2) | |
packageVersion("openxlsx2") | |
wb <- wb_workbook() %>% | |
wb_add_worksheet("table") %>% | |
wb_add_worksheet("data") %>% | |
wb_add_data(x = datasets::esoph) | |
df <- wb_data(wb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(openxlsx2) | |
if(exists("df_tmp")) {rm(df_tmp)} | |
a <- c("Above & Beyond", "Fully Met", "Partially Met", "Did Not Meet") # try using "&" instead of "and" | |
b <- c(.15, .70, .10, .05); | |
c <- c("","","","") | |
d <- c("","","","") | |
e <- c("","","","") | |
f <- c("","","","") | |
df_tmp <- data.frame(a,b,c,d,e,f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# openxlsx2 implementation of | |
# https://layalchristinelettry.rbind.io/blog/202303_openxlsx/ | |
# | |
#### helper function ----------------------------------------------------------- | |
prepare_penguins_mod <- function(data, | |
data_raw) { | |
# for demonstration purposes, add a column "any_comment" and "size" | |
data |> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(openxlsx2) # github with #496 for all tables | |
library(flextable) | |
### wrapper function to add flextable objects to openxlsx2 worksheets | |
wb_add_flextable <- function(wb, sheet = current_sheet(), ft) { | |
# get all rows to merge | |
merge_rows <- function(ft_part, part_rows) { | |
rows <- ft_part$spans$rows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(openxlsx2) | |
# example code | |
df<- tibble::tribble( | |
~Plant, ~Location, ~Status, ~Units, | |
"A", "E", "good", 0.95, | |
"C", "F", "good", 0.95, | |
"C", "E", "good", 0.95, | |
"B", "E", "good", 0.95, | |
"B", "F", "good", 0.89, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rundll32 sysdm.cpl,EditEnvironmentVariables | |
# add new: R_USER C:/Users/<username> | |
Sys.getenv("R_USER") | |
Sys.getenv("R_LIBS_USER") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(reshape2) | |
library(ragg) | |
library(ggplot2) | |
# devtools::install_github("opensdmx/rsdmx") | |
library(rsdmx) | |
usd_eur <- readSDMX("https://sdw-wsrest.ecb.europa.eu/service/data/EXR/D.USD.EUR.SP00.A") | |
usd_eur <- as.data.frame(usd_eur) | |
usd_eur <- usd_eur[c("obsTime", "obsValue")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Marcin (CTRL) Wieczorek <marcin@marcin.co> | |
# Contributor: Daniel Nagy <danielnagy at gmx de> | |
# Contributor: Mika Fischer <mika.fischer@zoopnet.de> | |
pkgname=soci | |
pkgver=4.0.1 | |
pkgrel=4 | |
pkgdesc="Database access library for C++" | |
arch=('i686' 'x86_64') | |
url="http://soci.sf.net" |
NewerOlder