Skip to content

Instantly share code, notes, and snippets.

View joaovissoci's full-sized avatar

Joao Ricardo N Vissoci joaovissoci

View GitHub Profile
@mattbaggott
mattbaggott / ggsurvival.R
Last active December 18, 2016 23:20
Functions to make ggplot KM survival / cumulative incidence plot from survfit() models ( library(survival) )
#
# Functions to make ggplot KM survivor curves made with survfit() in library(survival)
#
# code written by Ramon Saccilotto
# and included in his ggplot2 tutorial
# 2010-12-08
# define custom function to create a survival data.frame
createSurvivalFrame <- function(f.survfit){
# initialise frame variable
# script stolen from http://goo.gl/YbQyAQ
# install.packages("tm")
# install.packages("ggplot2")
# install.packages("lsa")
# install.packages("scatterplot3d")
library(tm)
library(ggplot2)
library(lsa)
library(scatterplot3d)

Helpful Sublime shortcuts from Josh Earl's Sublime Productivity and a few other sources

  • delete till beginning - CMD-DEL
  • paste and indent - SHIFT-CMD-V
  • convert case - CMD-U or CMD-L
  • split into lines (select text and adds cursor at the end of each line) - SHIFT-CMD-L
  • add previous or next line - CTRL-SHIFT-UP/DOWN (on a mac has to change mission control default shortcuts to avoid conflict)
  • quick skip next - used after CMD-D if you want to skip a word. use CMD-K CMD-D
  • add cursor to line above or below - CTRL-SHIFT-arrow up or down
  • expand selection to word - CMD-D
# all commands from http://git-scm.com/book
### Frequently used
#Clone repo
git clone LINK to REPO
#Commit changes
git commit -m 'comment'
git push origin master

Results for secondary data analyses

One structure that works, but certainly not the only one.

Length of each section will depend on the target journal and what has been established as socially acceptable within that local scientific group.

This template contains multiple elements from STROBE and SAMPL

Discussion template

The Discussion template presents a common structure used as a way to engage readers of peer-reviewed articles. Of importance, the structure to be presented here is one among many structure that might work, but this is certainly not the only one.

The length of each section in this template is not stipulated, primarily because length will depend on the target journal and what might have been established as socially acceptable within that local scientific community. This means that all four text blocks presented below could be written in a single paragraph or in two pages.

Novelty reinforcement and summary

  • Start by claiming the novelty of your article, thus aligning it with your previous statement in the Introduction about the existence of gap
  • Summarize the three or four main results from your study in a couple lines. The goal here is to let the reader know what you think are the main points they should focus on from everything that was presented within the Results section. It w

Methods for secondary data analyses

The Methods template presents a common structure used as a way to engage readers of peer-reviewed articles. Of importance, the structure to be presented here is one among many structure that might work, but this is certainly not the only one.

The length of each section in this template is not stipulated, primarily because length will depend on the target journal and what might have been established as socially acceptable within that local scientific community. This means that all four text blocks presented below could be written in a single paragraph or in two pages.

This template contains multiple elements from the STROBE and [SAMPL](http://www.equator-network.org/reporting-guidelines/basic-statistical-reporting-for-articles-published-in-biomedical-journals-the-statistical-analy

Introduction template

The Introduction template presents a common structure used as a way to engage readers of peer-reviewed articles. Of importance, the structure to be presented here is one among many structure that might work, but this is certainly not the only one.

The length of each section in this template is not stipulated, primarily because length will depend on the target journal and what might have been established as socially acceptable within that local scientific community. This means that all four text blocks presented below could be written in a single paragraph or in two pages.

Significance

  • Significance means the importance of the field as a whole rather than of your research question
  • Focus on facts rather than opinions

Agile principles summarized in key words

  1. Customer focus: Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.
  2. Adapting: Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage.
  3. Working cycles: Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.
  4. Teamwork: Business people and developers must work together daily throughout the project.
  5. Team support: Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.
  6. Communication: The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.
  7. Functioning product: Working software is the primary measure of progress.
  8. Iterative cycles: Agile processe
# options http://goo.gl/2JGwlX
Models
```{r, eval:TRUE, cache=TRUE, results=asis, warning=FALSE, error=TRUE, message=FALSE, include=FALSE, tidy=TRUE}
summary(cars)
```
Plots
```{r, fig.width=7, fig.height=6}
plot(cars)