{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "_cell_guid": "42e7c9e9-f2aa-ccc3-714c-fa3551ca183e"
      },
      "source": [
        "Testing the Kaggle env."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "a73df2b6-0e73-7c01-ab02-970b750454f4"
      },
      "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",
        "\n",
        "library(ggplot2) # Data visualization\n",
        "library(readr) # CSV file I/O, e.g. the read_csv function\n",
        "library(raster)\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",
        "files <- list.files(path=\"../input/three_band\", pattern=\"6100_1_\", full.names=T, recursive=FALSE)\n",
        "\n",
        "\n",
        "for (i in files){\n",
        "    str(i)\n",
        "}\n",
        "\n",
        "\n",
        "# Any results you write to the current directory are saved as output.\n",
        "# Rasters appear to already be stacked so no need for this:\n",
        "# rast.list <- lapply(1:length(files),\n",
        " # function(x) {\n",
        " # raster(files[x])\n",
        " # })\n",
        "\n",
        "# str(rast.list)\n",
        "\n",
        "# Bring a raster in - there's no CRS assigned.\n",
        "raster_6040_4_4 <- raster(\"../input/three_band/6040_4_4.tif\")\n",
        "ncol(raster_6040_4_4)\n",
        "nrow(raster_6040_4_4)\n",
        "plot(raster_6040_4_4)\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "a1710c78-f8cb-f45e-4d3a-a5a802f57f22"
      },
      "outputs": [],
      "source": [
        "# Comparing Rasters. Seem to be different widths\n",
        "raster_6040_4_3 <- raster(\"../input/three_band/6040_4_3.tif\")\n",
        "ncol(raster_6040_4_3)\n",
        "nrow(raster_6040_4_3)\n",
        "plot(raster_6040_4_3)"
      ]
    }
  ],
  "metadata": {
    "_change_revision": 0,
    "_is_fork": false,
    "kernelspec": {
      "display_name": "R",
      "language": "R",
      "name": "ir"
    },
    "language_info": {
      "codemirror_mode": "r",
      "file_extension": ".r",
      "mimetype": "text/x-r-source",
      "name": "R",
      "pygments_lexer": "r",
      "version": "3.3.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}