# This R environment comes with all of CRAN preinstalled, as well as many other helpful packages
# The environment is defined by the kaggle/rstats docker image: https://github.com/kaggle/docker-rstats
# For example, here's several helpful packages to load in 

library(ggplot2) # Data visualization
library(readr) # CSV file I/O, e.g. the read_csv function
library(magrittr)

# Input data files are available in the "../input/" directory.
# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory

#system("ls ../input")

trainfile <- "../input/train.csv"
testfile <- "../input/test.csv"
clientfile <- "../input/cliente_table.csv"

train <- trainfile %>% read.csv(nrows = 800000)
#test <- read_csv(testfile)
#dim(train)
#dim(test)
# Any results you write to the current directory are saved as output.

str(train)

#print(system("ls ../input/"))
clientfile <- "../input/cliente_tabla.csv"
client <- clientfile %>% read.csv()
str(client)

#print(system("ls ../input/"))
productfile <- "../input/producto_tabla.csv"
product <- productfile %>% read.csv()
str(product)
#print(system("ls ../input/"))
tsfile <- "../input/town_state.csv"
ts <- tsfile %>% read.csv()
str(ts)



summary(train)
hist(train$Demanda_uni_equil[train$Demanda_uni_equil<40])
hist(train$Dev_proxima)
