Skip to content

Instantly share code, notes, and snippets.

View dcomtois's full-sized avatar

Dominic Comtois dcomtois

View GitHub Profile
@dcomtois
dcomtois / dfSummary_shinyApp.R
Created February 27, 2021 02:06
A possible implementation of dfSummary as a shiny App
# Based on Thomas' answer on this Stack Overflow question:
# https://stackoverflow.com/questions/65792953/upload-a-file-and-use-summarytools-in-shiny/
# I fixed his answer so that it works but have no idea if it's optimal, having limited
# experience with shiny
library(shiny)
library(summarytools)
ui <- fluidPage(
sidebarLayout(
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
@dcomtois
dcomtois / rendering_lists.Rmd
Created April 11, 2018 08:28
Rmarkdown - question on StackOverflow about lists
---
title: "Rendering a list of objects in Rmarkdown"
author: "Dominic Comtois"
date: "`r Sys.Date()`"
output:
rmarkdown::html_vignette:
css:
- !expr system.file("rmarkdown/templates/html_vignette/resources/vignette.css", package = "rmarkdown")
- !expr system.file("includes/stylesheets/summarytools.css", package = "summarytools")
---
@dcomtois
dcomtois / userDefineLang.xml
Created December 23, 2016 04:02
Notepad++ style configuration for SAS
<NotepadPlus>
<UserLang name="sas" ext="sas" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00* 00; 01 02; 03/* 04*/</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@dcomtois
dcomtois / mydata.txt
Created October 26, 2016 16:03
Sample data for Cross-Validated Question
ID var valBin smok
1 Q11a 1 Yes
2 Q11a 1 Yes
3 Q11a 0 Yes
4 Q11a 0 Yes
5 Q11a 1 Yes
6 Q11a 0 Yes
7 Q11a 1 Yes
8 Q11a 1 Yes
9 Q11a 1 Yes
@dcomtois
dcomtois / letdate.sas
Created April 20, 2016 22:28
SAS Macro to easily assign dates to macro variables. Macro SAS pour définir facilement des variables macro dates.
/* ========================================================== */
/* Routine Macro %letdate */
/* ========================================================== */
/* */
/* Affecte une date à une variable macro */
/* et affiche sa valeur formattée au log. La donnée */
/* enregistrée reste une date SAS (numérique) ou non, */
/* selon le paramètre fmt fourni. */
/* */
/* Arguments: */
system.time(lotsOfNumbers <- rep(pi, 5e7))
system.time(lotsOfNumbers[1] <- 0)
system.time(lotsOfNumbers[2] <- 0)
@dcomtois
dcomtois / demo.R
Last active August 29, 2015 14:20
Mtl R Users Group, May 2015 - Introducing summarytools & thoughts on package development
# Presentation Mtl R Users Group, 2015-05-06
# Dominic Comtois
# Introduction à Summarytools / Introducing summarytools
# Liens / links
# https://github.com/dcomtois/summarytools
# http://www.statconseil.com
# [email protected]
# github method (need devtools installed) -- most up-to-date version of summarytools
@dcomtois
dcomtois / r_c.txt
Last active January 10, 2024 19:08
Linking R internal & primitive C functions with appropriate source files. --- printname = R function name ; c.entry = C function ; sourcefile = relevant C source file; line_no: line featuring fn definition (not all checked)
printname c.entry file line_no
- do_arith R-4.0.3\src\main\arithmetic.c 411
! do_logic R-4.0.3\src\main\logic.c 40
!= do_relop R-4.0.3\src\main\relop.c 51
$ do_subset3 R-4.0.3\src\main\subset.c 1206
$<- do_subassign3 R-4.0.3\src\main\subassign.c 2081
%% do_arith R-4.0.3\src\main\arithmetic.c 411
%*% do_matprod R-4.0.3\src\main\array.c 1228
%/% do_arith R-4.0.3\src\main\arithmetic.c 411
& do_logic R-4.0.3\src\main\logic.c 40