Skip to content

Instantly share code, notes, and snippets.

View gueyenono's full-sized avatar
💭
Currently working on the professorrr package

gueyenono

💭
Currently working on the professorrr package
View GitHub Profile
@Tutuchan
Tutuchan / diamonds_template.Rmd
Last active December 21, 2019 14:24
Loop over .Rmd chunks
```{r diamonds_{{color}}_{{cut}}_plot}
diamonds %>%
filter(
color == "{{color}}",
cut == "{{cut}}"
) %>%
ggplot(aes(carat, price, colour = clarity)) +
geom_point(show.legend = FALSE) +
labs(
title = 'Price by carat for diamonds with color {{color}} and cut {{cut}}'
@aagarw30
aagarw30 / DESCRIPTION
Last active April 23, 2020 22:04
Simple counter using reactiveValues() in R Shiny - An example
Title: reactiveValues() function
Description: With reactiveValues(), you can create your own reactive values. reactiveValues() Creates a list of objects that can be manipulated within a reactive context (within observer or observerEvent with dependency on changes in certain input or state of an object). reactiveValues() objects are not reactive themselves and do not re-execute themselves when input value changes unlike reactive objects. Powered by R, Shiny, and RStudio.
License: GPL-3
Author: Abhinav Agrawal
DisplayMode: Showcase
Tags: R, R Shiny,reactiveValues(), observeEvent()
Type: Shiny
@tonyerskine
tonyerskine / README.MD
Last active February 22, 2024 13:14
Windows Script to Convert Excel Files to CSV

Instructions

  1. Copy both files into the directory containing the files you want converted
  2. Run excel-to-csv.bat

Note: This script requires Excel to be installed.

@tbadams45
tbadams45 / uiOutput-in-modules.R
Last active June 28, 2023 18:25
How to use renderUI in shiny modules. Main takeaway: session$ns("id"). This works in nested modules, too. See the section on session$ns in the documentation for more information: http://shiny.rstudio.com/reference/shiny/latest/session.html
library(shiny)
library(dplyr)
library(ggplot2)
innerModUI <- function(id) {
ns <- NS(id)
fluidPage(fluidRow(
uiOutput(ns("inner_slider")),
@pvictor
pvictor / bb8_with_ggplot2.R
Created April 25, 2016 13:57
A Star Wars BB-8 with ggplot2 !
# BB-8 --------------------------------------------------------------------
# Inspired by Brian Hough in http://codepen.io/bhough/pen/wawrPL
# Packages ----------------------------------------------------------------
library("dplyr")
library("ggplot2")
@Pakillo
Pakillo / Rmarkdown-fontsize.Rmd
Created January 22, 2015 22:32
Changing font sizes of HTML ouput in Rmarkdown
---
title: "Untitled"
author: "Francisco Rodriguez-Sanchez"
date: "Thursday, January 22, 2015"
output: html_document
---
<style type="text/css">
body, td {
@gaberoo
gaberoo / 1-metropolis.R
Last active June 25, 2024 18:05
R code to run an **MCMC** chain using a **Metropolis-Hastings** algorithm with a Gaussian proposal distribution. Although there are hundreds of these in various packages, none that I could find returned the likelihood values along with the samples from the posterior distribution. However, if you have these likelihood values, it's very easy to ca…
##############################################################################
# Metropolis-Hastings MCMC
#
# Runs a Metropolis-Hasting MCMC chain for a given likelihood function.
# Proposal steps are sampled from a Gaussian distribution, either in a single
# step or sequentially over the parameter space.
#
# Input:
# theta : starting value of the chain
# lik.fun : likelihood function