{
  "id": 3614,
  "title": "Reading in event_friends.csv into R",
  "url": "/competitions/event-recommendation-engine-challenge/discussion/3614",
  "author_name": "",
  "post_date": "2013-01-17T01:30:58.943Z",
  "votes": 1,
  "comment_count": 2,
  "views": 1376,
  "content": "<p>I use R</p>\r\n<p>I have trouble reading in a.o. the user_friends.csv file. If I use read.csv() I get two colums: One of type numerical and the other of type character. The first one is the user-id, the second is the list of all her friends. I use scan() to split up the second\r\n colum into individual user id's but that takes a very significant amount of time.</p>\r\n<p>Does anybody know a faster way? Can you post a snippet of code?</p>\r\n<p>Thanks</p>",
  "messages": [
    {
      "id": "19379",
      "postDate": "01/17/2013 01:30:58",
      "content": "<p>I use R</p>\r\n<p>I have trouble reading in a.o. the user_friends.csv file. If I use read.csv() I get two colums: One of type numerical and the other of type character. The first one is the user-id, the second is the list of all her friends. I use scan() to split up the second\r\n colum into individual user id's but that takes a very significant amount of time.</p>\r\n<p>Does anybody know a faster way? Can you post a snippet of code?</p>\r\n<p>Thanks</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "19385",
      "postDate": "01/17/2013 07:26:57",
      "content": "<p>&nbsp;</p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">Hi\r\n Richard.</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">Maybe\r\n you will be useful to this code snippet:</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">#\r\n Read data</span></span></span></span></code></span></span></span></p>\r\n<p align=\"left\" style=\"line-height:0.45cm; widows:2; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; padding:0cm\">\r\n<code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">data&lt;-</span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">read.csv(</span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"ru-RU\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">\r\n &quot;user_friends.csv&quot;</span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">,\r\n header=TRUE,&nbsp; </span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">sep</span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">=&quot;,&quot;\r\n ,</span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:#fcfcfc\">stringsAsFactors\r\n = FALSE</span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">)</span></span></span></span></span></span></span></span></code></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends&lt;-as.character(</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends)</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends&lt;-</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">strsplit(</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">,'\r\n ')</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">#\r\n Determination of the number of friends, for the first entry</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">number_friends&lt;-</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">length(</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends[[1]])</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">#\r\n Reading the index first friend</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">ind_friends_first&lt;-as.numeric(data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends[[1]][1])</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">#\r\n Reading the index of the last friend</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">ind_friends_last&lt;-as.numeric(data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends[[1]][</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">number_friends</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">])</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">&gt;\r\n number_friends</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">[1]\r\n 3623</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">&gt;\r\n ind_friends_first</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">[1]\r\n 1346449342</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">&gt;\r\n ind_friends_last</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">[1]\r\n 2409895224</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n&nbsp;All the best,</p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\nAlex</p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "19388",
      "postDate": "01/17/2013 08:25:29",
      "content": "<p>Alex,</p>\r\n<p>Thanks. I tried your suggestion: It works just fine. Still takes ~5 min before it is done, but much better than my solution (~1&#43; hr)</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 19385,
      "author_name": "alexxanderlarko",
      "author_url": "",
      "post_date": "01/17/2013 07:26:57",
      "content": "<p>&nbsp;</p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">Hi\r\n Richard.</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">Maybe\r\n you will be useful to this code snippet:</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">#\r\n Read data</span></span></span></span></code></span></span></span></p>\r\n<p align=\"left\" style=\"line-height:0.45cm; widows:2; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; padding:0cm\">\r\n<code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">data&lt;-</span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">read.csv(</span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"ru-RU\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">\r\n &quot;user_friends.csv&quot;</span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">,\r\n header=TRUE,&nbsp; </span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">sep</span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">=&quot;,&quot;\r\n ,</span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:#fcfcfc\">stringsAsFactors\r\n = FALSE</span></span></span></span></span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><span lang=\"en-US\"><span style=\"font-style:normal\"><span style=\"font-weight:normal\"><span style=\"background:none transparent scroll repeat 0% 0%\">)</span></span></span></span></span></span></span></span></code></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends&lt;-as.character(</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends)</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends&lt;-</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">strsplit(</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">,'\r\n ')</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">#\r\n Determination of the number of friends, for the first entry</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">number_friends&lt;-</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">length(</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends[[1]])</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">#\r\n Reading the index first friend</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">ind_friends_first&lt;-as.numeric(data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends[[1]][1])</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">#\r\n Reading the index of the last friend</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">ind_friends_last&lt;-as.numeric(data$</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">friends[[1]][</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">number_friends</span></span></span></span></code><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">])</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">&gt;\r\n number_friends</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">[1]\r\n 3623</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">&gt;\r\n ind_friends_first</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">[1]\r\n 1346449342</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">&gt;\r\n ind_friends_last</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n<span style=\"color:#333333\"><span style=\"font-family:Times New Roman,serif\"><span style=\"font-size:small\"><code><span style=\"color:#000000\"><span style=\"text-decoration:none\"><span style=\"font-family:Times New Roman,serif\"><span style=\"background:none transparent scroll repeat 0% 0%\">[1]\r\n 2409895224</span></span></span></span></code></span></span></span></p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n&nbsp;All the best,</p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\nAlex</p>\r\n<p lang=\"en-US\" align=\"left\" style=\"line-height:0.45cm; widows:2; font-style:normal; orphans:2; margin-bottom:0cm; background:none transparent scroll repeat 0% 0%; font-weight:normal; padding:0cm\">\r\n&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 19388,
      "author_name": "richardfromholland",
      "author_url": "",
      "post_date": "01/17/2013 08:25:29",
      "content": "<p>Alex,</p>\r\n<p>Thanks. I tried your suggestion: It works just fine. Still takes ~5 min before it is done, but much better than my solution (~1&#43; hr)</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "19379": "",
    "19385": "",
    "19388": ""
  },
  "source": "meta"
}