Commit edbb2f77ba6dd469baa8a8b49ca79e91023768d9

Authored by Changtong Qiu
0 parents
Exists in master

First Commit

Showing 3 changed files with 77 additions and 0 deletions Side-by-side Diff

example.vimrc View file @ edbb2f7
... ... @@ -0,0 +1,51 @@
  1 +" ~/.vimrc
  2 +" Lisa McCutcheon
  3 +" Wed Feb 07, 2007
  4 +
  5 +" **************************************
  6 +" * VARIABLES
  7 +" **************************************
  8 +set nocompatible " get rid of strict vi compatibility!
  9 +set nu " line numbering on
  10 +set autoindent " autoindent on
  11 +set noerrorbells " bye bye bells :)
  12 +set modeline " show what I'm doing
  13 +set showmode " show the mode on the dedicated line (see above)
  14 +set nowrap " no wrapping!
  15 +set ignorecase " search without regards to case
  16 +set backspace=indent,eol,start " backspace over everything
  17 +set fileformats=unix,dos,mac " open files from mac/dos
  18 +set exrc " open local config files
  19 +set nojoinspaces " don't add white space when I don't tell you to
  20 +set ruler " which line am I on?
  21 +set showmatch " ensure Dyck language
  22 +set incsearch " incremental searching
  23 +set nohlsearch " meh
  24 +set bs=2 " fix backspacing in insert mode
  25 +set bg=light
  26 +
  27 +" Expand tabs in C files to spaces
  28 +au BufRead,BufNewFile *.{c,h,java} set expandtab
  29 +au BufRead,BufNewFile *.{c,h,java} set shiftwidth=2
  30 +au BufRead,BufNewFile *.{c,h,java} set tabstop=2
  31 +
  32 +" Do not expand tabs in assembly file. Make them 8 chars wide.
  33 +au BufRead,BufNewFile *.s set noexpandtab
  34 +au BufRead,BufNewFile *.s set shiftwidth=8
  35 +au BufRead,BufNewFile *.s set tabstop=8
  36 +
  37 +" Show syntax
  38 +syntax on
  39 +
  40 +" This is my prefered colorscheme, open a file with gvim to view others
  41 +:colors elflord
  42 +
  43 +" For switching between many opened file by using ctrl+l or ctrl+h
  44 +map <C-J> :next <CR>
  45 +map <C-K> :prev <CR>
  46 +
  47 +" Spelling toggle via F10 and F11
  48 +map <F10> <Esc>setlocal spell spelllang=en_us<CR>
  49 +map <F11> <Esc>setlocal nospell<CR>
  50 +
  51 +" setlocal textwidth=80 " used for text wrapping
example_code.R View file @ edbb2f7
... ... @@ -0,0 +1,25 @@
  1 +# Up and Running with R
  2 +# Ex06_01
  3 +# Calculating correlations
  4 +
  5 +# Load data file about Google searches by state
  6 +google <- read.csv("google_correlate.csv", header = T)
  7 +names(google)
  8 +
  9 +# Create data frame with only quantitative variables
  10 +g.quant <- google[c(3, 7, 4, 5)]
  11 +
  12 +# Correlation matrix for data frame
  13 +cor(g.quant)
  14 +
  15 +# Can test one pair of variables at a time
  16 +# Gives r, hypothesis test, and confidence interval
  17 +cor.test(g.quant$data_viz, g.quant$degree)
  18 +
  19 +# Install "Hmisc" package to get p-values for matrix
  20 +install.packages("Hmisc")
  21 +library("Hmisc")
  22 +
  23 +# Need to coerce g.quant from data frame to matrix
  24 +# to get correlation matrix and p-values
  25 +rcorr(as.matrix(g.quant))
google_correlate.csv View file @ edbb2f7
... ... @@ -0,0 +1 @@
  1 +State,state_code,data_viz,facebook,nba,has_nba,degree,stats_ed,region Alabama,AL,-0.69,1.93,-0.90,no,22.3,no,South Alaska,AK,-0.90,-0.52,-1.08,no,25.5,no,West Arizona,AZ,-0.20,-1.18,1.23,yes,28.0,no,West Arkansas,AR,-0.59,2.21,-1.10,no,18.8,yes,South California,CA,1.24,-1.28,1.65,yes,31.7,yes,West Colorado,CO,0.79,-1.33,-0.68,yes,35.5,no,West Connecticut,CT,0.32,-0.14,0.10,no,34.5,no,Northeast Delaware,DE,0.17,-0.34,0.03,no,26.9,no,South District of Columbia,DC,3.56,-2.20,-0.06,yes,45.7,yes,South Florida,FL,-0.80,0.10,0.29,yes,26.0,yes,South Georgia,GA,0.07,-0.20,0.02,yes,27.6,no,South Hawaii,HI,-0.76,-0.17,0.87,no,26.6,yes,West Idaho,ID,-0.38,-0.38,-1.00,no,23.8,no,West Illinois,IL,0.43,-0.49,1.45,yes,27.4,no,Midwest Indiana,IN,0.37,0.36,0.51,yes,21.1,yes,Midwest Iowa,IA,-0.34,0.73,-0.99,no,24.3,no,Midwest Kansas,KS,-0.87,-0.64,-0.65,no,30.0,no,Midwest Kentucky,KY,-0.90,1.39,0.07,no,21.0,no,South Louisiana,LA,-0.67,0.49,0.38,yes,22.4,no,South Maine,ME,-0.87,2.11,-0.59,no,24.2,no,Northeast Maryland,MD,1.60,-0.88,0.02,no,35.2,no,South Massachusetts,MA,2.62,-0.89,0.43,yes,36.7,no,Northeast Michigan,MI,-0.39,0.30,0.81,yes,24.4,no,Midwest Minnesota,MN,0.20,-0.15,-0.17,yes,32.5,no,Midwest Mississippi,MS,-1.00,2.56,0.08,no,20.1,yes,South Missouri,MO,-0.40,0.15,-1.46,no,28.1,no,Midwest Montana,MT,-0.43,0.47,-1.29,no,25.5,no,West Nebraska,NE,0.35,0.08,-1.08,no,24.8,no,Midwest Nevada,NV,-0.86,-0.59,1.26,no,24.5,no,West New Hampshire,NH,0.24,0.64,-0.77,no,35.4,no,Northeast New Jersey,NJ,0.01,-0.89,0.70,yes,34.6,no,Northeast New Mexico,NM,0.42,-0.49,-0.91,no,25.1,no,West New York,NY,1.17,-0.76,1.06,yes,30.6,no,Northeast North Carolina,NC,0.32,0.50,0.05,yes,23.4,yes,South North Dakota,ND,-1.17,0.86,0.00,no,25.2,no,Midwest Ohio,OH,-0.25,-0.03,0.99,yes,24.6,no,Midwest Oklahoma,OK,-1.05,0.04,0.06,yes,22.9,no,South Oregon,OR,0.96,-0.47,2.60,yes,25.9,no,West Pennsylvania,PA,0.14,-0.40,-0.60,yes,25.3,no,Northeast Rhode Island,RI,0.51,0.16,0.27,no,27.2,no,Northeast South Carolina,SC,-0.96,1.35,-0.59,no,24.9,yes,South South Dakota,SD,-1.15,-0.37,-0.44,no,25.5,no,Midwest Tennessee,TN,-0.52,0.97,-0.57,yes,24.3,yes,South Texas,TX,-0.08,-0.96,0.76,yes,24.5,no,South Utah,UT,0.49,-1.16,3.45,yes,30.8,yes,West Vermont,VT,-0.09,0.98,-1.11,no,34.2,no,Northeast Virginia,VA,1.70,-1.28,-0.52,no,33.1,yes,South Washington,WA,1.64,-1.34,-0.64,no,29.9,no,West West Virginia,WV,-1.19,1.18,-0.88,no,15.3,yes,South Wisconsin,WI,-0.62,-0.06,0.12,yes,25.6,no,Midwest Wyoming,WY,-1.18,0.05,-1.18,no,22.5,no,West
0 2 \ No newline at end of file