(you can modify the cran mirror)
R_VERSION='3.6.1'
wget https://cran.univ-paris1.fr/src/base/R-3/R-${R_VERSION}.tar.gz
<div class="post"> | |
<h2>{{ title }} </h2> | |
{{content}} | |
</div> |
library(patchwork) | |
library(ggplot2) | |
library(purrr) | |
library(dplyr) | |
library(glue) | |
map( | |
5:8, | |
~iris %>% | |
filter(Petal.Length < .x) %>% | |
ggplot() + |
library(shiny) | |
library(leaflet) | |
ui <- fluidPage( | |
h2("Where Am I?"), | |
tags$p("Click the button to get your coordinates"), | |
tags$button(onclick = "getLocation()", "Try it"), | |
tags$p(id = "where"), | |
leafletOutput("lf"), |
library(dygraphs) | |
library(magrittr) | |
df <- data.frame( | |
hour = seq( as.POSIXct("2019-01-01"), as.POSIXct("2019-01-02"), length.out = 48 ), | |
num = 1:48, | |
freq = rep(1:2, times = 24) | |
) | |
# Doesn't work | |
df %>% |
download.file("https://images1.westword.com/imager/u/745xauto/9813472/mg_3662.jpg", "img.jpg") | |
img <- jpeg::readJPEG("img.jpg") | |
library(ggplot2) | |
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + | |
annotation_custom(rasterGrob(img, | |
width = unit(1,"npc"), | |
height = unit(1,"npc"))) + | |
geom_point() | |
unlink("img.jpg") |
library(shiny) | |
# You can put input to both your functions | |
mod_ui <- function(id, title){ | |
# The ns here is a function that will help to 'namespace' the ids | |
# In other words, it will turn "go" into "chosennamespace-go" | |
ns <- NS(id) | |
tagList( | |
h2(title), | |
selectInput( |
library(shiny) | |
ui <- function(request){ | |
tagList( | |
tags$script( | |
"$(function(){ | |
$(this).bind('contextmenu', function (e) { | |
e.preventDefault() | |
Shiny.setInputValue('plop', Math.random()); | |
}); | |
});" |
--- | |
title: "Presentation Ninja" | |
subtitle: "⚔<br/>with xaringan" | |
author: "Yihui Xie" | |
institute: "RStudio, Inc." | |
date: "2016/12/12 (updated: `r Sys.Date()`)" | |
output: | |
xaringan::moon_reader: | |
lib_dir: libs | |
nature: |
browser_n <- function(n){ | |
i <- 0 | |
function(...){ | |
i <<- i + 1 | |
if (n >= i){ | |
browser(...) | |
} else { | |
invisible(NULL) | |
} | |
} |