{
  "id": 22525,
  "title": "Accessing by column name: Strange",
  "url": "/competitions/grupo-bimbo-inventory-demand/discussion/22525",
  "author_name": "",
  "post_date": "2016-07-27T14:13:50.787Z",
  "votes": null,
  "comment_count": 5,
  "views": 684,
  "content": "<p>Is it that the column names in R are limited by a maximum length?\nWhen I am trying to access the entries of a column which are 0, I am getting the same answer even without entering the entire column name, i.e. using PredDemand, PredDeman, PredDema, etc.\nPlease see the screenshot below:</p>\n\n<p>Why is this happening?</p>\n\n<p>Thanks.</p>",
  "messages": [
    {
      "id": "129203",
      "postDate": "07/27/2016 14:13:50",
      "content": "<p>Is it that the column names in R are limited by a maximum length?\nWhen I am trying to access the entries of a column which are 0, I am getting the same answer even without entering the entire column name, i.e. using PredDemand, PredDeman, PredDema, etc.\nPlease see the screenshot below:</p>\n\n<p>Why is this happening?</p>\n\n<p>Thanks.</p>",
      "rawMarkdown": "Is it that the column names in R are limited by a maximum length?\r\nWhen I am trying to access the entries of a column which are 0, I am getting the same answer even without entering the entire column name, i.e. using PredDemand, PredDeman, PredDema, etc.\r\nPlease see the screenshot below:\r\n\r\nWhy is this happening?\r\n\r\nThanks.",
      "votes": null
    },
    {
      "id": "129208",
      "postDate": "07/27/2016 14:41:28",
      "content": "<p>Without knowing more, I can guess the following: you are low on memory either because of the total amount of RAM in your machine, or because your current session has a lot of objects already there. Clean up the workspace a bit and try again. </p>",
      "rawMarkdown": "Without knowing more, I can guess the following: you are low on memory either because of the total amount of RAM in your machine, or because your current session has a lot of objects already there. Clean up the workspace a bit and try again.",
      "votes": null
    },
    {
      "id": "129210",
      "postDate": "07/27/2016 15:24:24",
      "content": "<p>Oh. There are a lot of objects in memory, but sufficient memory is free as well.\nIn any case, df$Thisisavariable should not be equal to df$Thisisa or df$Thisisavaria.\nIsn't it?</p>",
      "rawMarkdown": "Oh. There are a lot of objects in memory, but sufficient memory is free as well.\r\nIn any case, df$Thisisavariable should not be equal to df$Thisisa or df$Thisisavaria.\r\nIsn't it?",
      "votes": null
    },
    {
      "id": "129325",
      "postDate": "07/28/2016 19:36:16",
      "content": "<p>Looks like a feature to me.  I just tested and R will let you use a partial variable name as long as it can be resolved to a unique field.  If it can't, it will return NULL.  Never noticed that before - thanks!</p>",
      "rawMarkdown": "Looks like a feature to me.  I just tested and R will let you use a partial variable name as long as it can be resolved to a unique field.  If it can't, it will return NULL.  Never noticed that before - thanks!",
      "votes": null
    },
    {
      "id": "129449",
      "postDate": "07/29/2016 19:33:58",
      "content": "<p>Yep, it's a &quot;convenience&quot; feature, nothing to do with memory allocation. As long as there is a unique feature name that starts with your partial name R will return that feature.</p>\n\n<p>So for example <code>mtcars$dr == mtcars$drat</code>  and <code>mtcars$di == mtcars$disp</code> are true. \n However <code>mtcars$d</code> returns <code>NULL</code> since there are multiple features beginning with &quot;d&quot;.</p>",
      "rawMarkdown": "Yep, it's a \"convenience\" feature, nothing to do with memory allocation. As long as there is a unique feature name that starts with your partial name R will return that feature.\r\n\r\nSo for example `mtcars$dr == mtcars$drat`  and `mtcars$di == mtcars$disp` are true. \r\n However `mtcars$d` returns `NULL` since there are multiple features beginning with \"d\".",
      "votes": null
    },
    {
      "id": "129515",
      "postDate": "07/30/2016 15:54:37",
      "content": "<p>Thanks Alexandru for explaining the feature and crimeprophet for testing out the situation. Participating in the Grupo Bimbo challenge has helped us revisit an interesting feature of R.</p>",
      "rawMarkdown": "Thanks Alexandru for explaining the feature and crimeprophet for testing out the situation. Participating in the Grupo Bimbo challenge has helped us revisit an interesting feature of R.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 129208,
      "author_name": "konradb",
      "author_url": "",
      "post_date": "07/27/2016 14:41:28",
      "content": "<p>Without knowing more, I can guess the following: you are low on memory either because of the total amount of RAM in your machine, or because your current session has a lot of objects already there. Clean up the workspace a bit and try again. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 129210,
      "author_name": "singhn9",
      "author_url": "",
      "post_date": "07/27/2016 15:24:24",
      "content": "<p>Oh. There are a lot of objects in memory, but sufficient memory is free as well.\nIn any case, df$Thisisavariable should not be equal to df$Thisisa or df$Thisisavaria.\nIsn't it?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 129325,
      "author_name": "crimeprophet",
      "author_url": "",
      "post_date": "07/28/2016 19:36:16",
      "content": "<p>Looks like a feature to me.  I just tested and R will let you use a partial variable name as long as it can be resolved to a unique field.  If it can't, it will return NULL.  Never noticed that before - thanks!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 129449,
      "author_name": "apapiu",
      "author_url": "",
      "post_date": "07/29/2016 19:33:58",
      "content": "<p>Yep, it's a &quot;convenience&quot; feature, nothing to do with memory allocation. As long as there is a unique feature name that starts with your partial name R will return that feature.</p>\n\n<p>So for example <code>mtcars$dr == mtcars$drat</code>  and <code>mtcars$di == mtcars$disp</code> are true. \n However <code>mtcars$d</code> returns <code>NULL</code> since there are multiple features beginning with &quot;d&quot;.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 129515,
      "author_name": "singhn9",
      "author_url": "",
      "post_date": "07/30/2016 15:54:37",
      "content": "<p>Thanks Alexandru for explaining the feature and crimeprophet for testing out the situation. Participating in the Grupo Bimbo challenge has helped us revisit an interesting feature of R.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "129203": "Is it that the column names in R are limited by a maximum length?\r\nWhen I am trying to access the entries of a column which are 0, I am getting the same answer even without entering the entire column name, i.e. using PredDemand, PredDeman, PredDema, etc.\r\nPlease see the screenshot below:\r\n\r\nWhy is this happening?\r\n\r\nThanks.",
    "129208": "Without knowing more, I can guess the following: you are low on memory either because of the total amount of RAM in your machine, or because your current session has a lot of objects already there. Clean up the workspace a bit and try again.",
    "129210": "Oh. There are a lot of objects in memory, but sufficient memory is free as well.\r\nIn any case, df$Thisisavariable should not be equal to df$Thisisa or df$Thisisavaria.\r\nIsn't it?",
    "129325": "Looks like a feature to me.  I just tested and R will let you use a partial variable name as long as it can be resolved to a unique field.  If it can't, it will return NULL.  Never noticed that before - thanks!",
    "129449": "Yep, it's a \"convenience\" feature, nothing to do with memory allocation. As long as there is a unique feature name that starts with your partial name R will return that feature.\r\n\r\nSo for example `mtcars$dr == mtcars$drat`  and `mtcars$di == mtcars$disp` are true. \r\n However `mtcars$d` returns `NULL` since there are multiple features beginning with \"d\".",
    "129515": "Thanks Alexandru for explaining the feature and crimeprophet for testing out the situation. Participating in the Grupo Bimbo challenge has helped us revisit an interesting feature of R."
  },
  "source": "meta"
}