[data_exploration-12-5.R:9:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L9) *style:* **Put spaces around all infix operators.**
```r
hist(RETMONTH, breaks =60)
                      ^~
```
[data_exploration-12-5.R:11:35:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L11) *style:* **Put spaces around all infix operators.**
```r
(re_up <- length(RETMONTH[RETMONTH<0]))
                                 ~^~
```
[data_exploration-12-5.R:12:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L12) *style:* **Put spaces around all infix operators.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                   ~^~
```
[data_exploration-12-5.R:12:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L12) *style:* **Trailing whitespace is superfluous.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                         ^
```
[data_exploration-12-5.R:14:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
    ~^~
```
[data_exploration-12-5.R:14:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L14) *style:* **Place a space before left parenthesis, except in a function call.**
```r
re_up/(re_up+re_down)
      ^
```
[data_exploration-12-5.R:14:13:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
           ~^~
```
[data_exploration-12-5.R:16:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L16) *style:* **Put spaces around all infix operators.**
```r
up_down <- ifelse(RETMONTH >0, 1, 0)
                           ^~
```
[data_exploration-12-5.R:27:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                         ^
```
[data_exploration-12-5.R:27:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                           ^
```
[data_exploration-12-5.R:29:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L29) *style:* **Put spaces around all infix operators.**
```r
length(uniqueness[uniqueness<50])
                           ~^~
```
[data_exploration-12-5.R:31:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L31) *style:* **Put spaces around all infix operators.**
```r
which(uniqueness <50)
                 ^~
```
[data_exploration-12-5.R:35:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                               ^~~
```
[data_exploration-12-5.R:35:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L35) *style:* **Put spaces around all infix operators.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                      ~^
```
[data_exploration-12-5.R:35:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                         ^~~~~
```
[data_exploration-12-5.R:36:9:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L36) *style:* **Put spaces around all infix operators.**
```r
abline(h= mean(RETMONTH[n_low:n]), col = "blue", lwd = 2)
       ~^
```
[data_exploration-12-5.R:38:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                          ~^~
```
[data_exploration-12-5.R:38:53:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                                                   ~^~
```
[data_exploration-12-5.R:44:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L44) *style:* **Put spaces around all infix operators.**
```r
n_low <- n-1000
         ~^~
```
[data_exploration-12-5.R:44:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L44) *style:* **Trailing whitespace is superfluous.**
```r
n_low <- n-1000
               ^
```
[data_exploration-12-5.R:65:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L65) *style:* **Commas should always have a space after.**
```r
xs <- pca$x[n:n_low,1:9]
                    ^
```
[data_exploration-12-5.R:71:30:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L71) *style:* **Commas should always have a space after.**
```r
data2 <- data_no_ind[n_low:n,]
                             ^
```
[data_exploration-12-5.R:79:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L79) *style:* **Put spaces around all infix operators.**
```r
fit <- glm(updown~., data= data3, family = "binomial")
                        ~^
```
[data_exploration-12-5.R:83:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L83) *style:* **Put spaces around all infix operators.**
```r
cv_est <- cv.glm(data3, fit, K= 10)$delta[1]
                             ~^
```
[data_exploration-12-5.R:85:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L85) *style:* **Put spaces around all infix operators.**
```r
1-cv_est
~^~
```
[data_exploration-12-5.R:86:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/data_exploration-12-5.R#L86) *style:* **Trailing blank lines are superfluous.**
```r

^
```


[GPUAcceleratedClustering.R:4:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L4) *style:* **Only use double-quotes.**
```r
install.packages('rpud')
                 ^~~~~~
```
[GPUAcceleratedClustering.R:11:17:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L11) *style:* **Trailing whitespace is superfluous.**
```r
  set.seed(seed)
                ^
```
[GPUAcceleratedClustering.R:12:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L12) *style:* **Put spaces around all infix operators.**
```r
  matrix(rnorm(dim * num), nrow=num)
                              ~^~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L21) *style:* **Variable and function names should be all lowercase.**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L21) *warning:* **no visible global function definition for ‘rpuDist’**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L22) *style:* **Variable and function names should be all lowercase.**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L22) *warning:* **no visible global function definition for ‘rpuHclust’**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:35:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L35) *style:* **Put spaces around all infix operators.**
```r
print(system.time(cpuhclust <-run_cpu(m)))
                            ^~~
```
[GPUAcceleratedClustering.R:43:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/GPUAcceleratedClustering.R#L43) *style:* **Commas should always have a space after.**
```r
plot(gpuhclust,hang = -1)
               ^
```


[NeuralNet.R:6:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L6) *style:* **Only use double-quotes.**
```r
install.packages('neuralnet')
                 ^~~~~~~~~~~
```
[NeuralNet.R:12:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L12) *style:* **Use <-, not =, for assignment.**
```r
stockdata = read.csv("mf850-finalproject-data.csv")
          ^
```
[NeuralNet.R:13:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L13) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Date = NULL
               ^
```
[NeuralNet.R:14:20:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L14) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Industry = NULL
                   ^
```
[NeuralNet.R:15:14:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L15) *style:* **Use <-, not =, for assignment.**
```r
scaled_Stock = scale(stockdata)
             ^
```
[NeuralNet.R:16:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L16) *style:* **Use <-, not =, for assignment.**
```r
y = stockdata$RETMONTH_SPX
  ^
```
[NeuralNet.R:17:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L17) *style:* **Use <-, not =, for assignment.**
```r
x = stockdata
  ^
```
[NeuralNet.R:18:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L18) *style:* **Use <-, not =, for assignment.**
```r
x$RETMONTH_SPX = NULL
               ^
```
[NeuralNet.R:24:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L24) *style:* **Commas should always have a space after.**
```r
trainingdata <- cbind(traininginput,trainingoutput)
                                    ^
```
[NeuralNet.R:25:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L25) *style:* **Commas should always have a space after.**
```r
colnames(trainingdata) <- c("Input","Output")
                                    ^
```
[NeuralNet.R:31:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L31) *style:* **Commas should always have a space after.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                   ^
```
[NeuralNet.R:31:56:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                      ~^~
```
[NeuralNet.R:31:71:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                                     ~^~
```
[NeuralNet.R:38:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L38) *style:* **Place a space before left parenthesis, except in a function call.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                          ^
```
[NeuralNet.R:38:33:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L38) *style:* **Put spaces around all infix operators.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                               ~^~
```
[NeuralNet.R:48:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L48) *style:* **Commas should always have a space after.**
```r
cleanoutput <- cbind(testdata,sqrt(testdata),
                              ^
```
[NeuralNet.R:50:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                   ^
```
[NeuralNet.R:50:54:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                                     ^
```


[test.R:1:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L1) *style:* **Commented code should be removed.**
```r
#install.packages("devtools")
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[test.R:2:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L2) *style:* **Commented code should be removed.**
```r
#library(devtools)
 ^~~~~~~~~~~~~~~~~
```
[test.R:3:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L3) *style:* **Commented code should be removed.**
```r
#devtools::use_travis()
 ^~~~~~~~~~~~~~~~~~~~~~
```
[test.R:6:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L6) *style:* **Commas should always have a space after.**
```r
  packagestoinstall_split <- strsplit(packagestoinstall,", ")[[1]]
                                                        ^
```
[test.R:8:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L8) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(!packagename %in% rownames(installed.packages())){
      ^
```
[test.R:12:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L12) *style:* **Commas should always have a space after.**
```r
      print(paste(packagename,"already installed"))
                              ^
```
[test.R:14:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L14) *style:* **Put spaces around all infix operators.**
```r
    library(packagename, character.only=TRUE)
                                      ~^~
```
[test.R:25:4:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L25) *style:* **Put spaces around all infix operators.**
```r
  x+y
  ~^~
```
[test.R:27:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/156e8c4fdfeb18b98d85a2258d5560866dce9560/test.R#L27) *style:* **Commas should always have a space after.**
```r
f1(1,2)
     ^
```


Should have a return type (`void Book::get_checked_status() ...`)


Updated.


Use initializer list syntax:
```cpp
Book::Book(std::string title, bool checked_in)
        : title_(title),
          checked_in_(checked_in) {}
```


Please share PyRAS documentation.
I want to connect PyRAS and HEC RAS .
Please share some guidlines. So that I can follow.


これは三項演算子で，イコールの右辺を評価して真なら `?` 直後の式，偽なら `:` 直後の式を代入する
http://uxmilk.jp/49435


This should preferably be `private` (member variables should be private, methods public).


檔案名稱忘了留下姓名囉


[cm_v1.R:1:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L1) *style:* **Use two spaces to indent, never tabs.**
```r
require(rpart)
              ^
```
[cm_v1.R:1:43:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L1) *style:* **Use two spaces to indent, never tabs.**
```r
mydata$Industry=as.factor(mydata$Industry)
                                          ^
```
[cm_v1.R:2:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
     ~^~~
```
[cm_v1.R:2:22:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                    ~^~
```
[cm_v1.R:2:60:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                                                          ~^~
```
[cm_v1.R:2:70:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                                                                    ~^~
```
[cm_v1.R:5:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L5) *style:* **Trailing whitespace is superfluous.**
```r
require(rpart)
              ^
```
[cm_v1.R:6:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L6) *style:* **Use <-, not =, for assignment.**
```r
mydata$Industry=as.factor(mydata$Industry)
               ^
```
[cm_v1.R:6:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L6) *style:* **Put spaces around all infix operators.**
```r
mydata$Industry=as.factor(mydata$Industry)
              ~^~
```
[cm_v1.R:6:43:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L6) *style:* **Trailing whitespace is superfluous.**
```r
mydata$Industry=as.factor(mydata$Industry)
                                          ^
```
[cm_v1.R:7:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/cm_v1.R#L7) *style:* **Use <-, not =, for assignment.**
```r
contrasts(mydata$Industry) = contr.treatment(213)
                           ^
```


[data_exploration-12-5.R:9:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L9) *style:* **Put spaces around all infix operators.**
```r
hist(RETMONTH, breaks =60)
                      ^~
```
[data_exploration-12-5.R:11:35:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L11) *style:* **Put spaces around all infix operators.**
```r
(re_up <- length(RETMONTH[RETMONTH<0]))
                                 ~^~
```
[data_exploration-12-5.R:12:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L12) *style:* **Put spaces around all infix operators.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                   ~^~
```
[data_exploration-12-5.R:12:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L12) *style:* **Trailing whitespace is superfluous.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                         ^
```
[data_exploration-12-5.R:14:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
    ~^~
```
[data_exploration-12-5.R:14:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L14) *style:* **Place a space before left parenthesis, except in a function call.**
```r
re_up/(re_up+re_down)
      ^
```
[data_exploration-12-5.R:14:13:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
           ~^~
```
[data_exploration-12-5.R:16:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L16) *style:* **Put spaces around all infix operators.**
```r
up_down <- ifelse(RETMONTH >0, 1, 0)
                           ^~
```
[data_exploration-12-5.R:27:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                         ^
```
[data_exploration-12-5.R:27:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                           ^
```
[data_exploration-12-5.R:29:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L29) *style:* **Put spaces around all infix operators.**
```r
length(uniqueness[uniqueness<50])
                           ~^~
```
[data_exploration-12-5.R:31:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L31) *style:* **Put spaces around all infix operators.**
```r
which(uniqueness <50)
                 ^~
```
[data_exploration-12-5.R:35:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                               ^~~
```
[data_exploration-12-5.R:35:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L35) *style:* **Put spaces around all infix operators.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                      ~^
```
[data_exploration-12-5.R:35:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                         ^~~~~
```
[data_exploration-12-5.R:36:9:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L36) *style:* **Put spaces around all infix operators.**
```r
abline(h= mean(RETMONTH[n_low:n]), col = "blue", lwd = 2)
       ~^
```
[data_exploration-12-5.R:38:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                          ~^~
```
[data_exploration-12-5.R:38:53:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                                                   ~^~
```
[data_exploration-12-5.R:44:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L44) *style:* **Put spaces around all infix operators.**
```r
n_low <- n-1000
         ~^~
```
[data_exploration-12-5.R:44:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L44) *style:* **Trailing whitespace is superfluous.**
```r
n_low <- n-1000
               ^
```
[data_exploration-12-5.R:65:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L65) *style:* **Commas should always have a space after.**
```r
xs <- pca$x[n:n_low,1:9]
                    ^
```
[data_exploration-12-5.R:71:30:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L71) *style:* **Commas should always have a space after.**
```r
data2 <- data_no_ind[n_low:n,]
                             ^
```
[data_exploration-12-5.R:79:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L79) *style:* **Put spaces around all infix operators.**
```r
fit <- glm(updown~., data= data3, family = "binomial")
                        ~^
```
[data_exploration-12-5.R:83:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L83) *style:* **Put spaces around all infix operators.**
```r
cv_est <- cv.glm(data3, fit, K= 10)$delta[1]
                             ~^
```
[data_exploration-12-5.R:85:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L85) *style:* **Put spaces around all infix operators.**
```r
1-cv_est
~^~
```
[data_exploration-12-5.R:86:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/data_exploration-12-5.R#L86) *style:* **Trailing blank lines are superfluous.**
```r

^
```


[GPUAcceleratedClustering.R:4:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L4) *style:* **Only use double-quotes.**
```r
install.packages('rpud')
                 ^~~~~~
```
[GPUAcceleratedClustering.R:11:17:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L11) *style:* **Trailing whitespace is superfluous.**
```r
  set.seed(seed)
                ^
```
[GPUAcceleratedClustering.R:12:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L12) *style:* **Put spaces around all infix operators.**
```r
  matrix(rnorm(dim * num), nrow=num)
                              ~^~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L21) *style:* **Variable and function names should be all lowercase.**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L21) *warning:* **no visible global function definition for ‘rpuDist’**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L22) *style:* **Variable and function names should be all lowercase.**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L22) *warning:* **no visible global function definition for ‘rpuHclust’**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:35:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L35) *style:* **Put spaces around all infix operators.**
```r
print(system.time(cpuhclust <-run_cpu(m)))
                            ^~~
```
[GPUAcceleratedClustering.R:43:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/GPUAcceleratedClustering.R#L43) *style:* **Commas should always have a space after.**
```r
plot(gpuhclust,hang = -1)
               ^
```


[NeuralNet.R:6:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L6) *style:* **Only use double-quotes.**
```r
install.packages('neuralnet')
                 ^~~~~~~~~~~
```
[NeuralNet.R:12:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L12) *style:* **Use <-, not =, for assignment.**
```r
stockdata = read.csv("mf850-finalproject-data.csv")
          ^
```
[NeuralNet.R:13:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L13) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Date = NULL
               ^
```
[NeuralNet.R:14:20:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L14) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Industry = NULL
                   ^
```
[NeuralNet.R:15:14:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L15) *style:* **Use <-, not =, for assignment.**
```r
scaled_Stock = scale(stockdata)
             ^
```
[NeuralNet.R:16:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L16) *style:* **Use <-, not =, for assignment.**
```r
y = stockdata$RETMONTH_SPX
  ^
```
[NeuralNet.R:17:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L17) *style:* **Use <-, not =, for assignment.**
```r
x = stockdata
  ^
```
[NeuralNet.R:18:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L18) *style:* **Use <-, not =, for assignment.**
```r
x$RETMONTH_SPX = NULL
               ^
```
[NeuralNet.R:24:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L24) *style:* **Commas should always have a space after.**
```r
trainingdata <- cbind(traininginput,trainingoutput)
                                    ^
```
[NeuralNet.R:25:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L25) *style:* **Commas should always have a space after.**
```r
colnames(trainingdata) <- c("Input","Output")
                                    ^
```
[NeuralNet.R:31:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L31) *style:* **Commas should always have a space after.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                   ^
```
[NeuralNet.R:31:56:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                      ~^~
```
[NeuralNet.R:31:71:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                                     ~^~
```
[NeuralNet.R:38:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L38) *style:* **Place a space before left parenthesis, except in a function call.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                          ^
```
[NeuralNet.R:38:33:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L38) *style:* **Put spaces around all infix operators.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                               ~^~
```
[NeuralNet.R:48:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L48) *style:* **Commas should always have a space after.**
```r
cleanoutput <- cbind(testdata,sqrt(testdata),
                              ^
```
[NeuralNet.R:50:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                   ^
```
[NeuralNet.R:50:54:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                                     ^
```


[test.R:1:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L1) *style:* **Commented code should be removed.**
```r
#install.packages("devtools")
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[test.R:2:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L2) *style:* **Commented code should be removed.**
```r
#library(devtools)
 ^~~~~~~~~~~~~~~~~
```
[test.R:3:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L3) *style:* **Commented code should be removed.**
```r
#devtools::use_travis()
 ^~~~~~~~~~~~~~~~~~~~~~
```
[test.R:6:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L6) *style:* **Commas should always have a space after.**
```r
  packagestoinstall_split <- strsplit(packagestoinstall,", ")[[1]]
                                                        ^
```
[test.R:8:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L8) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(!packagename %in% rownames(installed.packages())){
      ^
```
[test.R:12:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L12) *style:* **Commas should always have a space after.**
```r
      print(paste(packagename,"already installed"))
                              ^
```
[test.R:14:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L14) *style:* **Put spaces around all infix operators.**
```r
    library(packagename, character.only=TRUE)
                                      ~^~
```
[test.R:25:4:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L25) *style:* **Put spaces around all infix operators.**
```r
  x+y
  ~^~
```
[test.R:27:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/cc2a34d0e40eae3002a0a0b31a04de89a05fe65a/test.R#L27) *style:* **Commas should always have a space after.**
```r
f1(1,2)
     ^
```


In the theme it's only used once, but generally it's better to split into many templates so that you can overwrite smaller parts within the pages using the theme.


OK, this one is a little out of order. While trying the first section of part 3, Modals, I ran into a problem. Instead of spending the evening debugging that I went on to dropdowns, which did work out.


[cm_v1.R:1:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L1) *style:* **Use two spaces to indent, never tabs.**
```r
require(rpart)
              ^
```
[cm_v1.R:1:43:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L1) *style:* **Use two spaces to indent, never tabs.**
```r
mydata$Industry=as.factor(mydata$Industry)
                                          ^
```
[cm_v1.R:2:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
     ~^~~
```
[cm_v1.R:2:22:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                    ~^~
```
[cm_v1.R:2:60:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                                                          ~^~
```
[cm_v1.R:2:70:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                                                                    ~^~
```
[cm_v1.R:5:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L5) *style:* **Trailing whitespace is superfluous.**
```r
require(rpart)
              ^
```
[cm_v1.R:6:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L6) *style:* **Use <-, not =, for assignment.**
```r
mydata$Industry=as.factor(mydata$Industry)
               ^
```
[cm_v1.R:6:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L6) *style:* **Put spaces around all infix operators.**
```r
mydata$Industry=as.factor(mydata$Industry)
              ~^~
```
[cm_v1.R:6:43:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L6) *style:* **Trailing whitespace is superfluous.**
```r
mydata$Industry=as.factor(mydata$Industry)
                                          ^
```
[cm_v1.R:7:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/cm_v1.R#L7) *style:* **Use <-, not =, for assignment.**
```r
contrasts(mydata$Industry) = contr.treatment(213)
                           ^
```


[data_exploration-12-5.R:9:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L9) *style:* **Put spaces around all infix operators.**
```r
hist(RETMONTH, breaks =60)
                      ^~
```
[data_exploration-12-5.R:11:35:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L11) *style:* **Put spaces around all infix operators.**
```r
(re_up <- length(RETMONTH[RETMONTH<0]))
                                 ~^~
```
[data_exploration-12-5.R:12:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L12) *style:* **Put spaces around all infix operators.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                   ~^~
```
[data_exploration-12-5.R:12:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L12) *style:* **Trailing whitespace is superfluous.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                         ^
```
[data_exploration-12-5.R:14:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
    ~^~
```
[data_exploration-12-5.R:14:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L14) *style:* **Place a space before left parenthesis, except in a function call.**
```r
re_up/(re_up+re_down)
      ^
```
[data_exploration-12-5.R:14:13:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
           ~^~
```
[data_exploration-12-5.R:16:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L16) *style:* **Put spaces around all infix operators.**
```r
up_down <- ifelse(RETMONTH >0, 1, 0)
                           ^~
```
[data_exploration-12-5.R:27:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                         ^
```
[data_exploration-12-5.R:27:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                           ^
```
[data_exploration-12-5.R:29:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L29) *style:* **Put spaces around all infix operators.**
```r
length(uniqueness[uniqueness<50])
                           ~^~
```
[data_exploration-12-5.R:31:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L31) *style:* **Put spaces around all infix operators.**
```r
which(uniqueness <50)
                 ^~
```
[data_exploration-12-5.R:35:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                               ^~~
```
[data_exploration-12-5.R:35:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L35) *style:* **Put spaces around all infix operators.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                      ~^
```
[data_exploration-12-5.R:35:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                         ^~~~~
```
[data_exploration-12-5.R:36:9:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L36) *style:* **Put spaces around all infix operators.**
```r
abline(h= mean(RETMONTH[n_low:n]), col = "blue", lwd = 2)
       ~^
```
[data_exploration-12-5.R:38:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                          ~^~
```
[data_exploration-12-5.R:38:53:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                                                   ~^~
```
[data_exploration-12-5.R:44:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L44) *style:* **Put spaces around all infix operators.**
```r
n_low <- n-1000
         ~^~
```
[data_exploration-12-5.R:44:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L44) *style:* **Trailing whitespace is superfluous.**
```r
n_low <- n-1000
               ^
```
[data_exploration-12-5.R:65:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L65) *style:* **Commas should always have a space after.**
```r
xs <- pca$x[n:n_low,1:9]
                    ^
```
[data_exploration-12-5.R:71:30:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L71) *style:* **Commas should always have a space after.**
```r
data2 <- data_no_ind[n_low:n,]
                             ^
```
[data_exploration-12-5.R:79:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L79) *style:* **Put spaces around all infix operators.**
```r
fit <- glm(updown~., data= data3, family = "binomial")
                        ~^
```
[data_exploration-12-5.R:83:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L83) *style:* **Put spaces around all infix operators.**
```r
cv_est <- cv.glm(data3, fit, K= 10)$delta[1]
                             ~^
```
[data_exploration-12-5.R:85:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L85) *style:* **Put spaces around all infix operators.**
```r
1-cv_est
~^~
```
[data_exploration-12-5.R:86:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/data_exploration-12-5.R#L86) *style:* **Trailing blank lines are superfluous.**
```r

^
```


[GPUAcceleratedClustering.R:4:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L4) *style:* **Only use double-quotes.**
```r
install.packages('rpud')
                 ^~~~~~
```
[GPUAcceleratedClustering.R:11:17:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L11) *style:* **Trailing whitespace is superfluous.**
```r
  set.seed(seed)
                ^
```
[GPUAcceleratedClustering.R:12:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L12) *style:* **Put spaces around all infix operators.**
```r
  matrix(rnorm(dim * num), nrow=num)
                              ~^~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L21) *style:* **Variable and function names should be all lowercase.**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L21) *warning:* **no visible global function definition for ‘rpuDist’**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L22) *style:* **Variable and function names should be all lowercase.**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L22) *warning:* **no visible global function definition for ‘rpuHclust’**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:35:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L35) *style:* **Put spaces around all infix operators.**
```r
print(system.time(cpuhclust <-run_cpu(m)))
                            ^~~
```
[GPUAcceleratedClustering.R:43:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/GPUAcceleratedClustering.R#L43) *style:* **Commas should always have a space after.**
```r
plot(gpuhclust,hang = -1)
               ^
```


[NeuralNet.R:6:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L6) *style:* **Only use double-quotes.**
```r
install.packages('neuralnet')
                 ^~~~~~~~~~~
```
[NeuralNet.R:12:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L12) *style:* **Use <-, not =, for assignment.**
```r
stockdata = read.csv("mf850-finalproject-data.csv")
          ^
```
[NeuralNet.R:13:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L13) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Date = NULL
               ^
```
[NeuralNet.R:14:20:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L14) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Industry = NULL
                   ^
```
[NeuralNet.R:15:14:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L15) *style:* **Use <-, not =, for assignment.**
```r
scaled_Stock = scale(stockdata)
             ^
```
[NeuralNet.R:16:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L16) *style:* **Use <-, not =, for assignment.**
```r
y = stockdata$RETMONTH_SPX
  ^
```
[NeuralNet.R:17:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L17) *style:* **Use <-, not =, for assignment.**
```r
x = stockdata
  ^
```
[NeuralNet.R:18:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L18) *style:* **Use <-, not =, for assignment.**
```r
x$RETMONTH_SPX = NULL
               ^
```
[NeuralNet.R:24:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L24) *style:* **Commas should always have a space after.**
```r
trainingdata <- cbind(traininginput,trainingoutput)
                                    ^
```
[NeuralNet.R:25:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L25) *style:* **Commas should always have a space after.**
```r
colnames(trainingdata) <- c("Input","Output")
                                    ^
```
[NeuralNet.R:31:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L31) *style:* **Commas should always have a space after.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                   ^
```
[NeuralNet.R:31:56:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                      ~^~
```
[NeuralNet.R:31:71:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                                     ~^~
```
[NeuralNet.R:38:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L38) *style:* **Place a space before left parenthesis, except in a function call.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                          ^
```
[NeuralNet.R:38:33:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L38) *style:* **Put spaces around all infix operators.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                               ~^~
```
[NeuralNet.R:48:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L48) *style:* **Commas should always have a space after.**
```r
cleanoutput <- cbind(testdata,sqrt(testdata),
                              ^
```
[NeuralNet.R:50:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                   ^
```
[NeuralNet.R:50:54:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                                     ^
```


[test.R:1:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L1) *style:* **Commented code should be removed.**
```r
#install.packages("devtools")
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[test.R:2:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L2) *style:* **Commented code should be removed.**
```r
#library(devtools)
 ^~~~~~~~~~~~~~~~~
```
[test.R:3:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L3) *style:* **Commented code should be removed.**
```r
#devtools::use_travis()
 ^~~~~~~~~~~~~~~~~~~~~~
```
[test.R:6:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L6) *style:* **Commas should always have a space after.**
```r
  packagestoinstall_split <- strsplit(packagestoinstall,", ")[[1]]
                                                        ^
```
[test.R:8:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L8) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(!packagename %in% rownames(installed.packages())){
      ^
```
[test.R:12:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L12) *style:* **Commas should always have a space after.**
```r
      print(paste(packagename,"already installed"))
                              ^
```
[test.R:14:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L14) *style:* **Put spaces around all infix operators.**
```r
    library(packagename, character.only=TRUE)
                                      ~^~
```
[test.R:25:4:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L25) *style:* **Put spaces around all infix operators.**
```r
  x+y
  ~^~
```
[test.R:27:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/811da4a76ef7852a0e56247ba4ae9940cd40ffa9/test.R#L27) *style:* **Commas should always have a space after.**
```r
f1(1,2)
     ^
```


Ugh, fixed.


So, with `map` you actually want to use something slightly different from `std::find`:
```cpp
auto found = map.find(key);
```
This difference is because the normal `std::find` usually applies to the entire value being iterated over, which for a `std::map<A, B>` is `std::pair<A, B>`.


added the start and end point of detection


FYI I believe there's a function classList.toggle(className, bool) that could simplify this a little


String defaults to empty. If you want to explicitly set it to empty, use String::EMPTY


[cm_v1.R:1:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L1) *style:* **Use two spaces to indent, never tabs.**
```r
require(rpart)
              ^
```
[cm_v1.R:1:43:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L1) *style:* **Use two spaces to indent, never tabs.**
```r
mydata$Industry=as.factor(mydata$Industry)
                                          ^
```
[cm_v1.R:2:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
     ~^~~
```
[cm_v1.R:2:22:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                    ~^~
```
[cm_v1.R:2:60:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                                                          ~^~
```
[cm_v1.R:2:70:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                                                                    ~^~
```
[cm_v1.R:5:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L5) *style:* **Trailing whitespace is superfluous.**
```r
require(rpart)
              ^
```
[cm_v1.R:6:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L6) *style:* **Use <-, not =, for assignment.**
```r
mydata$Industry=as.factor(mydata$Industry)
               ^
```
[cm_v1.R:6:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L6) *style:* **Put spaces around all infix operators.**
```r
mydata$Industry=as.factor(mydata$Industry)
              ~^~
```
[cm_v1.R:6:43:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L6) *style:* **Trailing whitespace is superfluous.**
```r
mydata$Industry=as.factor(mydata$Industry)
                                          ^
```
[cm_v1.R:7:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/cm_v1.R#L7) *style:* **Use <-, not =, for assignment.**
```r
contrasts(mydata$Industry) = contr.treatment(213)
                           ^
```


[data_exploration-12-5.R:9:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L9) *style:* **Put spaces around all infix operators.**
```r
hist(RETMONTH, breaks =60)
                      ^~
```
[data_exploration-12-5.R:11:35:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L11) *style:* **Put spaces around all infix operators.**
```r
(re_up <- length(RETMONTH[RETMONTH<0]))
                                 ~^~
```
[data_exploration-12-5.R:12:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L12) *style:* **Put spaces around all infix operators.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                   ~^~
```
[data_exploration-12-5.R:12:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L12) *style:* **Trailing whitespace is superfluous.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                         ^
```
[data_exploration-12-5.R:14:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
    ~^~
```
[data_exploration-12-5.R:14:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L14) *style:* **Place a space before left parenthesis, except in a function call.**
```r
re_up/(re_up+re_down)
      ^
```
[data_exploration-12-5.R:14:13:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
           ~^~
```
[data_exploration-12-5.R:16:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L16) *style:* **Put spaces around all infix operators.**
```r
up_down <- ifelse(RETMONTH >0, 1, 0)
                           ^~
```
[data_exploration-12-5.R:27:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                         ^
```
[data_exploration-12-5.R:27:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                           ^
```
[data_exploration-12-5.R:29:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L29) *style:* **Put spaces around all infix operators.**
```r
length(uniqueness[uniqueness<50])
                           ~^~
```
[data_exploration-12-5.R:31:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L31) *style:* **Put spaces around all infix operators.**
```r
which(uniqueness <50)
                 ^~
```
[data_exploration-12-5.R:35:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                               ^~~
```
[data_exploration-12-5.R:35:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L35) *style:* **Put spaces around all infix operators.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                      ~^
```
[data_exploration-12-5.R:35:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                         ^~~~~
```
[data_exploration-12-5.R:36:9:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L36) *style:* **Put spaces around all infix operators.**
```r
abline(h= mean(RETMONTH[n_low:n]), col = "blue", lwd = 2)
       ~^
```
[data_exploration-12-5.R:38:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                          ~^~
```
[data_exploration-12-5.R:38:53:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                                                   ~^~
```
[data_exploration-12-5.R:44:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L44) *style:* **Put spaces around all infix operators.**
```r
n_low <- n-1000
         ~^~
```
[data_exploration-12-5.R:44:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L44) *style:* **Trailing whitespace is superfluous.**
```r
n_low <- n-1000
               ^
```
[data_exploration-12-5.R:65:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L65) *style:* **Commas should always have a space after.**
```r
xs <- pca$x[n:n_low,1:9]
                    ^
```
[data_exploration-12-5.R:71:30:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L71) *style:* **Commas should always have a space after.**
```r
data2 <- data_no_ind[n_low:n,]
                             ^
```
[data_exploration-12-5.R:79:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L79) *style:* **Put spaces around all infix operators.**
```r
fit <- glm(updown~., data= data3, family = "binomial")
                        ~^
```
[data_exploration-12-5.R:83:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L83) *style:* **Put spaces around all infix operators.**
```r
cv_est <- cv.glm(data3, fit, K= 10)$delta[1]
                             ~^
```
[data_exploration-12-5.R:85:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L85) *style:* **Put spaces around all infix operators.**
```r
1-cv_est
~^~
```
[data_exploration-12-5.R:86:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/data_exploration-12-5.R#L86) *style:* **Trailing blank lines are superfluous.**
```r

^
```


[GPUAcceleratedClustering.R:4:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L4) *style:* **Only use double-quotes.**
```r
install.packages('rpud')
                 ^~~~~~
```
[GPUAcceleratedClustering.R:11:17:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L11) *style:* **Trailing whitespace is superfluous.**
```r
  set.seed(seed)
                ^
```
[GPUAcceleratedClustering.R:12:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L12) *style:* **Put spaces around all infix operators.**
```r
  matrix(rnorm(dim * num), nrow=num)
                              ~^~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L21) *style:* **Variable and function names should be all lowercase.**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L21) *warning:* **no visible global function definition for ‘rpuDist’**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L22) *style:* **Variable and function names should be all lowercase.**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L22) *warning:* **no visible global function definition for ‘rpuHclust’**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:35:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L35) *style:* **Put spaces around all infix operators.**
```r
print(system.time(cpuhclust <-run_cpu(m)))
                            ^~~
```
[GPUAcceleratedClustering.R:43:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/GPUAcceleratedClustering.R#L43) *style:* **Commas should always have a space after.**
```r
plot(gpuhclust,hang = -1)
               ^
```


[NeuralNet.R:6:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L6) *style:* **Only use double-quotes.**
```r
install.packages('neuralnet')
                 ^~~~~~~~~~~
```
[NeuralNet.R:12:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L12) *style:* **Use <-, not =, for assignment.**
```r
stockdata = read.csv("mf850-finalproject-data.csv")
          ^
```
[NeuralNet.R:13:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L13) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Date = NULL
               ^
```
[NeuralNet.R:14:20:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L14) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Industry = NULL
                   ^
```
[NeuralNet.R:15:14:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L15) *style:* **Use <-, not =, for assignment.**
```r
scaled_Stock = scale(stockdata)
             ^
```
[NeuralNet.R:16:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L16) *style:* **Use <-, not =, for assignment.**
```r
y = stockdata$RETMONTH_SPX
  ^
```
[NeuralNet.R:17:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L17) *style:* **Use <-, not =, for assignment.**
```r
x = stockdata
  ^
```
[NeuralNet.R:18:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L18) *style:* **Use <-, not =, for assignment.**
```r
x$RETMONTH_SPX = NULL
               ^
```
[NeuralNet.R:24:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L24) *style:* **Commas should always have a space after.**
```r
trainingdata <- cbind(traininginput,trainingoutput)
                                    ^
```
[NeuralNet.R:25:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L25) *style:* **Commas should always have a space after.**
```r
colnames(trainingdata) <- c("Input","Output")
                                    ^
```
[NeuralNet.R:31:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L31) *style:* **Commas should always have a space after.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                   ^
```
[NeuralNet.R:31:56:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                      ~^~
```
[NeuralNet.R:31:71:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                                     ~^~
```
[NeuralNet.R:38:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L38) *style:* **Place a space before left parenthesis, except in a function call.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                          ^
```
[NeuralNet.R:38:33:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L38) *style:* **Put spaces around all infix operators.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                               ~^~
```
[NeuralNet.R:48:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L48) *style:* **Commas should always have a space after.**
```r
cleanoutput <- cbind(testdata,sqrt(testdata),
                              ^
```
[NeuralNet.R:50:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                   ^
```
[NeuralNet.R:50:54:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                                     ^
```


[test.R:1:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L1) *style:* **Commented code should be removed.**
```r
#install.packages("devtools")
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[test.R:2:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L2) *style:* **Commented code should be removed.**
```r
#library(devtools)
 ^~~~~~~~~~~~~~~~~
```
[test.R:3:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L3) *style:* **Commented code should be removed.**
```r
#devtools::use_travis()
 ^~~~~~~~~~~~~~~~~~~~~~
```
[test.R:6:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L6) *style:* **Commas should always have a space after.**
```r
  packagestoinstall_split <- strsplit(packagestoinstall,", ")[[1]]
                                                        ^
```
[test.R:8:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L8) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(!packagename %in% rownames(installed.packages())){
      ^
```
[test.R:12:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L12) *style:* **Commas should always have a space after.**
```r
      print(paste(packagename,"already installed"))
                              ^
```
[test.R:14:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L14) *style:* **Put spaces around all infix operators.**
```r
    library(packagename, character.only=TRUE)
                                      ~^~
```
[test.R:25:4:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L25) *style:* **Put spaces around all infix operators.**
```r
  x+y
  ~^~
```
[test.R:27:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2f0af3fb5bd849c318a6a0306d4494187507b3b7/test.R#L27) *style:* **Commas should always have a space after.**
```r
f1(1,2)
     ^
```


componets  更正為 component


Danke


理解


[cm_v1.R:1:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L1) *style:* **Use two spaces to indent, never tabs.**
```r
require(rpart)
              ^
```
[cm_v1.R:1:43:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L1) *style:* **Use two spaces to indent, never tabs.**
```r
mydata$Industry=as.factor(mydata$Industry)
                                          ^
```
[cm_v1.R:2:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
     ~^~~
```
[cm_v1.R:2:22:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                    ~^~
```
[cm_v1.R:2:60:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                                                          ~^~
```
[cm_v1.R:2:70:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L2) *style:* **Put spaces around all infix operators.**
```r
mydata<-read.csv(file="mf850-finalproject-data.csv", header=TRUE, sep=",")
                                                                    ~^~
```
[cm_v1.R:5:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L5) *style:* **Trailing whitespace is superfluous.**
```r
require(rpart)
              ^
```
[cm_v1.R:6:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L6) *style:* **Use <-, not =, for assignment.**
```r
mydata$Industry=as.factor(mydata$Industry)
               ^
```
[cm_v1.R:6:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L6) *style:* **Put spaces around all infix operators.**
```r
mydata$Industry=as.factor(mydata$Industry)
              ~^~
```
[cm_v1.R:6:43:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L6) *style:* **Trailing whitespace is superfluous.**
```r
mydata$Industry=as.factor(mydata$Industry)
                                          ^
```
[cm_v1.R:7:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/cm_v1.R#L7) *style:* **Use <-, not =, for assignment.**
```r
contrasts(mydata$Industry) = contr.treatment(213)
                           ^
```


[data_exploration-12-5.R:9:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L9) *style:* **Put spaces around all infix operators.**
```r
hist(RETMONTH, breaks =60)
                      ^~
```
[data_exploration-12-5.R:11:35:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L11) *style:* **Put spaces around all infix operators.**
```r
(re_up <- length(RETMONTH[RETMONTH<0]))
                                 ~^~
```
[data_exploration-12-5.R:12:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L12) *style:* **Put spaces around all infix operators.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                   ~^~
```
[data_exploration-12-5.R:12:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L12) *style:* **Trailing whitespace is superfluous.**
```r
(re_down <- length(RETMONTH[RETMONTH>0]))
                                         ^
```
[data_exploration-12-5.R:14:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
    ~^~
```
[data_exploration-12-5.R:14:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L14) *style:* **Place a space before left parenthesis, except in a function call.**
```r
re_up/(re_up+re_down)
      ^
```
[data_exploration-12-5.R:14:13:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L14) *style:* **Put spaces around all infix operators.**
```r
re_up/(re_up+re_down)
           ~^~
```
[data_exploration-12-5.R:16:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L16) *style:* **Put spaces around all infix operators.**
```r
up_down <- ifelse(RETMONTH >0, 1, 0)
                           ^~
```
[data_exploration-12-5.R:27:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                         ^
```
[data_exploration-12-5.R:27:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L27) *style:* **Commas should always have a space after.**
```r
uniqueness <- apply(data,2,numb_unique)
                           ^
```
[data_exploration-12-5.R:29:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L29) *style:* **Put spaces around all infix operators.**
```r
length(uniqueness[uniqueness<50])
                           ~^~
```
[data_exploration-12-5.R:31:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L31) *style:* **Put spaces around all infix operators.**
```r
which(uniqueness <50)
                 ^~
```
[data_exploration-12-5.R:35:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                               ^~~
```
[data_exploration-12-5.R:35:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L35) *style:* **Put spaces around all infix operators.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                      ~^
```
[data_exploration-12-5.R:35:42:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L35) *style:* **Only use double-quotes.**
```r
plot(RETMONTH[n_low:n], type = 'l', col= 'red', lwd = 2)
                                         ^~~~~
```
[data_exploration-12-5.R:36:9:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L36) *style:* **Put spaces around all infix operators.**
```r
abline(h= mean(RETMONTH[n_low:n]), col = "blue", lwd = 2)
       ~^
```
[data_exploration-12-5.R:38:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                          ~^~
```
[data_exploration-12-5.R:38:53:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L38) *style:* **Put spaces around all infix operators.**
```r
MSE_i <- (RETMONTH[n_low:n]-mean(RETMONTH[n_low:n]))^2
                                                   ~^~
```
[data_exploration-12-5.R:44:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L44) *style:* **Put spaces around all infix operators.**
```r
n_low <- n-1000
         ~^~
```
[data_exploration-12-5.R:44:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L44) *style:* **Trailing whitespace is superfluous.**
```r
n_low <- n-1000
               ^
```
[data_exploration-12-5.R:65:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L65) *style:* **Commas should always have a space after.**
```r
xs <- pca$x[n:n_low,1:9]
                    ^
```
[data_exploration-12-5.R:71:30:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L71) *style:* **Commas should always have a space after.**
```r
data2 <- data_no_ind[n_low:n,]
                             ^
```
[data_exploration-12-5.R:79:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L79) *style:* **Put spaces around all infix operators.**
```r
fit <- glm(updown~., data= data3, family = "binomial")
                        ~^
```
[data_exploration-12-5.R:83:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L83) *style:* **Put spaces around all infix operators.**
```r
cv_est <- cv.glm(data3, fit, K= 10)$delta[1]
                             ~^
```
[data_exploration-12-5.R:85:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L85) *style:* **Put spaces around all infix operators.**
```r
1-cv_est
~^~
```
[data_exploration-12-5.R:86:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/data_exploration-12-5.R#L86) *style:* **Trailing blank lines are superfluous.**
```r

^
```


[GPUAcceleratedClustering.R:4:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L4) *style:* **Only use double-quotes.**
```r
install.packages('rpud')
                 ^~~~~~
```
[GPUAcceleratedClustering.R:11:17:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L11) *style:* **Trailing whitespace is superfluous.**
```r
  set.seed(seed)
                ^
```
[GPUAcceleratedClustering.R:12:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L12) *style:* **Put spaces around all infix operators.**
```r
  matrix(rnorm(dim * num), nrow=num)
                              ~^~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L21) *style:* **Variable and function names should be all lowercase.**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:21:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L21) *warning:* **no visible global function definition for ‘rpuDist’**
```r
  dgpu <- rpuDist(matrix)
          ^~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L22) *style:* **Variable and function names should be all lowercase.**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:22:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L22) *warning:* **no visible global function definition for ‘rpuHclust’**
```r
  rpuHclust(dgpu)
  ^~~~~~~~~
```
[GPUAcceleratedClustering.R:35:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L35) *style:* **Put spaces around all infix operators.**
```r
print(system.time(cpuhclust <-run_cpu(m)))
                            ^~~
```
[GPUAcceleratedClustering.R:43:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/GPUAcceleratedClustering.R#L43) *style:* **Commas should always have a space after.**
```r
plot(gpuhclust,hang = -1)
               ^
```


[NeuralNet.R:6:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L6) *style:* **Only use double-quotes.**
```r
install.packages('neuralnet')
                 ^~~~~~~~~~~
```
[NeuralNet.R:12:11:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L12) *style:* **Use <-, not =, for assignment.**
```r
stockdata = read.csv("mf850-finalproject-data.csv")
          ^
```
[NeuralNet.R:13:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L13) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Date = NULL
               ^
```
[NeuralNet.R:14:20:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L14) *style:* **Use <-, not =, for assignment.**
```r
stockdata$Industry = NULL
                   ^
```
[NeuralNet.R:15:14:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L15) *style:* **Use <-, not =, for assignment.**
```r
scaled_Stock = scale(stockdata)
             ^
```
[NeuralNet.R:16:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L16) *style:* **Use <-, not =, for assignment.**
```r
y = stockdata$RETMONTH_SPX
  ^
```
[NeuralNet.R:17:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L17) *style:* **Use <-, not =, for assignment.**
```r
x = stockdata
  ^
```
[NeuralNet.R:18:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L18) *style:* **Use <-, not =, for assignment.**
```r
x$RETMONTH_SPX = NULL
               ^
```
[NeuralNet.R:24:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L24) *style:* **Commas should always have a space after.**
```r
trainingdata <- cbind(traininginput,trainingoutput)
                                    ^
```
[NeuralNet.R:25:37:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L25) *style:* **Commas should always have a space after.**
```r
colnames(trainingdata) <- c("Input","Output")
                                    ^
```
[NeuralNet.R:31:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L31) *style:* **Commas should always have a space after.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                   ^
```
[NeuralNet.R:31:56:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                      ~^~
```
[NeuralNet.R:31:71:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L31) *style:* **Put spaces around all infix operators.**
```r
net.sqrt <- neuralnet(Output~Input,trainingdata, hidden=100, threshold=0.01)
                                                                     ~^~
```
[NeuralNet.R:38:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L38) *style:* **Place a space before left parenthesis, except in a function call.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                          ^
```
[NeuralNet.R:38:33:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L38) *style:* **Put spaces around all infix operators.**
```r
testdata <- as.data.frame((1:10)^2) #Generate some squared numbers
                               ~^~
```
[NeuralNet.R:48:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L48) *style:* **Commas should always have a space after.**
```r
cleanoutput <- cbind(testdata,sqrt(testdata),
                              ^
```
[NeuralNet.R:50:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                   ^
```
[NeuralNet.R:50:54:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/2201bf0234e09255cfdd433c65e16ed54961874f/NeuralNet.R#L50) *style:* **Commas should always have a space after.**
```r
colnames(cleanoutput) <- c("Input","Expected Output","Neural Net Output")
                                                     ^
```