R #
I have not used R for a long time. Proceed at your own risk.
Moved from: (Private repo) loikein/my-jupyter-notes
(Maybe) Useful resources #
- An Introduction to Statistical Learning
- cis-ds/course-site: Course site for Computing for Information Science (INFO 5940)
- swirldev/swirl_courses: :mortar_board: A collection of interactive courses for the swirl R package.
- R for Data Science (1e)
- R Programming for Data Science
- Data Carpentry Lessons
- The R Graph Gallery – Help and inspiration for R charts
- R 语言教程 李东风
- List: XiangyunHuang/R-Tutorial: R 语言材料
Configuration #
Set language on macOS: (credit)
# (In .zshrc)
export LANG=en_US.UTF-8
Check all environment variables:
Sys.getenv()
Sys.getlocale()
Check the location of RHOME
:
R RHOME
List of common packages #
Install:
## plot
install.packages("gapminder")
install.packages("dplyr")
install.packages("ggplot2")
## import
install.packages("readr")
install.packages("data.table")
install.packages("readxl")
install.packages("gdata")
install.packages("DBI")
install.packages("httr")
install.packages("jsonlite")
install.packages("haven")
install.packages("foreign")
## clean
install.packages("tidyr")
install.packages("lubridate")
install.packages("stringr")
## function
install.packages("purrr")
Load:
## plot
library(gapminder)
library(ggplot2)
## import
library(readr)
library(data.table)
library(readxl)
library(gdata)
library(DBI)
library(httr)
library(jsonlite)
library(haven)
library(foreign)
## data
library(dplyr)
library(hflights)
## clean
library(tidyr)
library(lubridate)
library(stringr)
## function
library(purrr)
## trading models
library(quantmod)
Package: base
#
c()
#
Append: (credit)
vector <- c()
values <- c('a','b','c','d','e','f','g')
for (v in values){
vector <- c(vector, v)
}
Package: distr
#
Make distribution: (credit)
mean <- 1
sigma <- 0.25
(n <- Norm(mean=mean,sd=sigma))
# Distribution Object of Class: Norm
# mean: 1
# sd: 0.25
Binder #
I have stopped using Binder. Proceed at your own risk.
Refs:
- matthewfeickert/R-in-Jupyter-with-Binder: Example of how to use R in Jupyter notebooks and make compatible with Binder
- Configuration Files — Binder 0.1b documentation
runtime.txt
:
r-2018-11-16
requirements.txt
:
jupyter_contrib_nbextensions
postBuild
:
jupyter contrib nbextension install --user
jupyter nbextension enable toc2
jupyter trust binder-r-test.ipynb