{"cells":[
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": "# This R environment comes with all of CRAN preinstalled, as well as many other helpful packages\n# The environment is defined by the kaggle/rstats docker image: https://github.com/kaggle/docker-rstats\n# For example, here's several helpful packages to load in \n\nlibrary(ggplot2) # Data visualization\nlibrary(readr) # CSV file I/O, e.g. the read_csv function\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nsystem(\"ls ../input\")\n\n# Any results you write to the current directory are saved as output.\n\ntrain<-read_csv('../input/train.csv')\ndim(train)\ntest<-read_csv('../input/test.csv')\ndim(test)\n\n\nstr(train)\nstr(test)\nprint(\"nlevels(as.factor(train$srch_destination_id))\")\n\nnlevels(as.factor(train$srch_destination_id))\nprint(\"nlevels(as.factor(test$srch_destination_id))\")\nnlevels(as.factor(test$srch_destination_id))\n\n\n\nnlevels(as.factor(train$site_name))\nnlevels(as.factor(train$posa_continent))\nnlevels(as.factor(train$user_location_country ))\nnlevels(as.factor(train$user_location_region))\nplot(density(train$orig_destination_distance[!is.na(train$orig_destination_distance)]))\nnlevels(as.factor(train$user_id))\nnlevels(as.factor(train$is_mobile))\ntable(train$is_mobile)\nnlevels(as.factor(train$is_package))\nnlevels(as.factor(train$channel))\nnlevels(as.factor(train$srch_adults_cnt))\nhist(as.numeric(train$srch_adults_cnt))\nnlevels(as.factor(train$srch_children_cnt))\nhist(as.numeric(train$srch_children_cnt))\nhist(as.numeric(train$srch_rm_cnt))\nnlevels(as.factor(train$srch_destination_id))\nnlevels(as.factor(train$srch_destination_type_id))\nhist((train$srch_destination_type_id))\nsum(train$is_booking)\nhist(train$cnt)\n\nnlevels(as.factor(train$hotel_continent))\ntable(as.factor(train$hotel_continent))\nnlevels(as.factor(train$hotel_country ))\ntable(as.factor(train$hotel_country ))\nnlevels(as.factor(train$market))\nnlevels(as.factor(train$hotel_cluster))\n\nimpcolumns<-c(2, 4,7, 9, 10, 14, 15, 16, 18, 19, 24)\nnewtrain<-train[, impcolumns]\nhead(newtrain)\n\n\n\n\n"
 },
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": "id<-test$srch_destination_id[1]\nnewdata<-train[which(train$srch_destination_id==id),]\nstr(newdata)\n\n\n\n\n"
 }
],"metadata":{"kernelspec":{"display_name":"R","language":"R","name":"ir"}}, "nbformat": 4, "nbformat_minor": 0}