# Time to start looking at the features
# Here is a visualization of the non-character variables
# https://www.kaggle.com/rshah4/liberty-mutual-group-property-inspection-prediction/correlation-matrix-visualization
# The readr library is the best way to read and write CSV files in R
library(readr)
library(corrplot)

# The competition datafiles are in the directory ../input
# Read competition data files:
train <- read_csv("../input/training.csv")
test <- read_csv("../input/test.csv")
train <- train[,-c(1)]

# Write to the log:
cat(sprintf("Training set has %d rows and %d columns\n", nrow(train), ncol(train)))
cat(sprintf("Test set has %d rows and %d columns\n", nrow(test), ncol(test)))

M <- cor(train[sapply(train, function(x) !is.character(x))])
#corrplot(M, method = "ellipse",order = "hclust")
##Updated
png(height=1200, width=1200, file="cor_matrix.png")
corrplot(M, method = "number",order = "hclust",type='lower', diag=F, addCoefasPercent=T) 
   