Skip to content

Instantly share code, notes, and snippets.

Nick Carchedi ncarchedi

Block or report user

Report or block ncarchedi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ncarchedi on github.
  • I am n10i (https://keybase.io/n10i) on keybase.
  • I have a public key ASDUJBvM1uS2YIEbzJMzv2dZNIJhEX-jFyyxx5PGv-iFago

To claim this, I am signing this object:

@ncarchedi
ncarchedi / test.md
Created Sep 15, 2017
Example of line breaks between paragraphs
View test.md

This is an example paragraph.

And here's another. Notice the amount of space between paragraphs, which makes the text more readable (especially when there's lots of it).

@ncarchedi
ncarchedi / server.R
Last active May 13, 2019
Dynamically append arbitrary number of inputs (Shiny)
View server.R
library(shiny)
shinyServer(function(input, output) {
# Initialize list of inputs
inputTagList <- tagList()
output$allInputs <- renderUI({
# Get value of button, which represents number of times pressed (i.e. number of inputs added)
i <- input$appendInput
@ncarchedi
ncarchedi / autoSave.R
Created Nov 10, 2013
This short R script initiates a callback function called saveWork. Every time a valid R command is executed in the console, the user's workspace will be automatically saved to the usual .Rdata file in the current working directory. This is particularly useful if the user is concerned about losing his or her work due to computer or software insta…
View autoSave.R
saveWork <- function(...) {
save.image()
TRUE
}
addTaskCallback(saveWork, name="autoSave")
View sounds.r
# Script to help understanding of S3 object-oriented programming
# in R using classes and methods
# Constructor functions for various classes of animal
pig <- function() structure(list(), class=c("pig", "animal"))
dog <- function() structure(list(), class=c("dog", "animal"))
cat <- function() structure(list(), class=c("cat", "animal"))
makeSound <- function(x) UseMethod("makeSound")
@ncarchedi
ncarchedi / s3intro.R
Last active Jan 8, 2016
Script to help understanding of S3 object-oriented programming in R using classes and methods
View s3intro.R
# Script to help understanding of S3 object-oriented programming
# in R using classes and methods
# Constructor functions for various classes of animal
pig <- function() structure(list(), class="pig")
dog <- function() structure(list(), class="dog")
cat <- function() structure(list(), class="cat")
# Generic makeSound function
makeSound <- function(x) UseMethod("makeSound")
View frndly.r
# A tutorial navigates through a series of states, either manually, with
# nxt(), prv(), jmp() etc, or automatically, by using addTaskCallback() and
# checking that preconditions are met.
#
# Each state has:
# * a message
# * a next state (a function name)
# (eventually may have multiple next named states)
# * an auto test
#
You can’t perform that action at this time.