Developers Guide

options(rmarkdown.html_vignette.check_title = FALSE)
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Contributions are welcome and can come in different forms, including but not limited to:

Please read the following documents before making changes to the codebase.

Environment Setup

In order to contribute to the project, it is a better idea to have your own local copy of CausalGPS on your Github account. Here are the steps:

git clone git@github.com:[your user name]/CausalGPS.git

Git Branching Model

Although, in your personal repository, you can pick any branch name, however, in order to keep consistency and also understand who is working on what, the following convention is strongly recommended. In this project, we follow the convention that is proposed by Vincent Driessen in his A successful Git branching model post.

Here is the summary of the branches:

Where to submit pull requests?

All pull requests should be submitted to base repository: NSAPH-Software/CausalGPS and base: develop branch.

Pull request checklist

Reporting bugs

Please report potential bugs by creating a new issue or sending us an email. Please include the following information in your bug report:

Style Guide

In this project, we follow the tidyverse style guide.

Summary

Names

Spaces and Indentation

#Acceptable:
z <- x + y

#Not recommended:
z<-x+y # (no space)
z<- x+y
z<-x +y
#Acceptable:
a <- matrix(c(1:100), nrow = 5)

#Not recommended:
a <- matrix(c(1:100),nrow = 5) # (no space after comma)
a <- matrix( c(1:100), nrow = 5 ) # (extra space after and before parentheses)
a<-matrix(c(1:100), nrow = 5) # (no space around unary operator <- )
#Acceptable:
# This is a comment

#Not recommended:
#This is a comment
#    This is a comment (more than one space after #)
## This is a comment (multiple #)
###    This is a comment (multiple # and more than one space)
#Acceptable:
x <- (z + y)

#Not recommended:
x <- ( z + y ) # (unnecessary space)
x <- (z + y )
x <- ( z + y)
#Acceptible
if (x > 2) {
  print(x)
}

# Not recommended
if(x > 2){
  print(x)
}

Other notes

Notes on SuperLearner

In this package we create a customized wrapper for the SuperLearner internal libraries. Please read Notes on SL Wrappers for more details.

Logger

Use logger to investigate the internal process. The default level is "INFO", which writes messages into "CausalGPS.log" file. You can use update_logger function to change the log file location and level.



Try the CausalGPS package in your browser

Any scripts or data that you put into this service are public.

CausalGPS documentation built on Sept. 30, 2023, 1:06 a.m.