-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.Rmd
90 lines (69 loc) · 2.02 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
title: "Difusión de Publicaciones"
description: "Se presenta aquí el conjunto de publicaciones que realiza la Dirección Nacional de Mercados y Estadística de la [Subsecretaría de Turismo](https://www.argentina.gob.ar/turismo)."
site: distill::distill_website
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
```
```{r echo = FALSE, warning = FALSE, message = FALSE}
### Cargo librerías
#toastui version compatible con web
devtools::install_version("toastui", version = "0.2.1", repos = "http://cran.us.r-project.org", quiet = T)
library(tidyverse)
library(toastui)
```
```{r}
#system("rm -r docs/site_libs")
### Importar calendario fuente
# Desactivo pedido de acceso
googlesheets4::gs4_deauth()
path <- Sys.getenv("CALENDAR_PATH")
# Traigo base de calendario
base <- googlesheets4::read_sheet(path)
### Limpieza de base
calendario <- base %>%
rename(title = titulo,
body = descripcion) %>%
mutate(start = as.Date(paste(anio, mes, dia, sep = "-")),
end = start,
category = "allday",
calendarId = 123) %>%
select(title, body, category, start, end, calendarId) %>%
drop_na()
```
```{r, echo = FALSE}
publicados <- base %>% filter(if_any(.cos = everything(),
.fns = ~ !is.na(.)))
write_csv(x = publicados, ".github/data/calendario_publicado.csv")
```
```{r}
### Armo calendario
calendar(
navigation = TRUE,
navOpts = navigation_options(
today_label = "Hoy",
class = "bttn-stretch bttn-sm bttn-warning",
color = "#50535C",
fmt_date = format("MM/YYYY"),
sep_date = "-"
)
) %>%
cal_month_options(
startDayOfWeek = 7,
daynames =
#c("Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab"),
c("D", "L", "M", "M", "J", "V", "S"),
narrowWeekend = TRUE,
isAlways6Week = F
) %>%
cal_schedules(
calendario
) %>%
cal_props(
id = 123,
color = "#37BBED", #cian
bgColor = "white",
borderColor = "#EE3D8F" #rosa
)
```