{
  "id": 1298,
  "title": " could not find function \"%dopar%\" ",
  "url": "/competitions/WhatDoYouKnow/discussion/1298",
  "author_name": "",
  "post_date": "2012-01-22T04:46:14.793Z",
  "votes": null,
  "comment_count": 6,
  "views": 7082,
  "content": "<p>&nbsp;Hello guys, i am new to R. while using bigmemory &#43; foreach i have encountered this error -&nbsp;</p>\r\n<pre> could not find function &quot;%dopar%&quot;</pre>\r\n<pre>can anyone help me with this?</pre>\r\n<pre>&nbsp;</pre>\r\n<pre>Here is code i am using</pre>\r\n<pre>#importing packages</pre>\r\n<pre>install.packages(&quot;bigmemory&quot;)<br>install.packages(&quot;biganalytics&quot;)<br><br>library(bigmemory)<br>library(biganalytics)</pre>\r\n<pre>#filling featureUsersAbility Matrix<br>foreach(user=users)%dopar%{<br>\t<br>\tforeach(feature_name=feature_names)%dopar%{<br><br>\t\tfeature=strsplit(feature_name,&quot; &quot;)<br>\t\tprint(feature)<br><br>\t\t#here we are simply putting the correct/total in usersability<br>\t\ttotalRecords=mwhich(training,c(&quot;user_id&quot;,feature[[1]][1]),list(user,feature[[1]][2]),&quot;eq&quot;,&quot;AND&quot;)<br>\t\tcorrectRecords=mwhich(training,c(&quot;user_id&quot;,feature[[1]][1],&quot;outcome&quot;),list(user,feature[[1]][2],1),&quot;eq&quot;,&quot;AND&quot;)<br>\t\tprint(totalRecords)<br>\t\tprint(correctRecords)<br>\t\tif(length(correctRecords)&gt;0){<br>\t\t\tfeature_UserAbility[user,feature_name]&lt;-length(correctRecords)/length(totalRecords)<br>\t\t}<br>\t}<br>}</pre>",
  "messages": [
    {
      "id": "8212",
      "postDate": "01/22/2012 04:46:14",
      "content": "<p>&nbsp;Hello guys, i am new to R. while using bigmemory &#43; foreach i have encountered this error -&nbsp;</p>\r\n<pre> could not find function &quot;%dopar%&quot;</pre>\r\n<pre>can anyone help me with this?</pre>\r\n<pre>&nbsp;</pre>\r\n<pre>Here is code i am using</pre>\r\n<pre>#importing packages</pre>\r\n<pre>install.packages(&quot;bigmemory&quot;)<br>install.packages(&quot;biganalytics&quot;)<br><br>library(bigmemory)<br>library(biganalytics)</pre>\r\n<pre>#filling featureUsersAbility Matrix<br>foreach(user=users)%dopar%{<br>\t<br>\tforeach(feature_name=feature_names)%dopar%{<br><br>\t\tfeature=strsplit(feature_name,&quot; &quot;)<br>\t\tprint(feature)<br><br>\t\t#here we are simply putting the correct/total in usersability<br>\t\ttotalRecords=mwhich(training,c(&quot;user_id&quot;,feature[[1]][1]),list(user,feature[[1]][2]),&quot;eq&quot;,&quot;AND&quot;)<br>\t\tcorrectRecords=mwhich(training,c(&quot;user_id&quot;,feature[[1]][1],&quot;outcome&quot;),list(user,feature[[1]][2],1),&quot;eq&quot;,&quot;AND&quot;)<br>\t\tprint(totalRecords)<br>\t\tprint(correctRecords)<br>\t\tif(length(correctRecords)&gt;0){<br>\t\t\tfeature_UserAbility[user,feature_name]&lt;-length(correctRecords)/length(totalRecords)<br>\t\t}<br>\t}<br>}</pre>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8214",
      "postDate": "01/22/2012 04:47:30",
      "content": "<p>Also where can i get good forums on R , where i can discuss about R?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8219",
      "postDate": "01/22/2012 19:30:36",
      "content": "<p>dopar is from the package &quot;foreach&quot; I don't see you having loaded it...</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8253",
      "postDate": "01/25/2012 00:58:24",
      "content": "<p>It may not help much, but Quick-R (http://www.statmethods.net/) Is a pretty great website to get familiar, err... &quot;quickly&quot; with what R has to offer.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8254",
      "postDate": "01/25/2012 04:31:40",
      "content": "<p>Thanks podo for link, actually i had to reinstall R , then the issue i mentioned got resolved. Now i am facing more pronounced issue. I am using bigmemory fo handling large datasets and doSMP for parallelism. But when i try to execute foreach loop it hangs\r\n my computer and starts showingme microsoft errors. Do you anything about it?</p>\r\n<p>This is code i am trying to execute</p>\r\n<pre>x&lt;-foreach(user=users[1:2])%:%<br>foreach(feature_name=feature_names[1:3],.packages=c(&quot;bigankalytics&quot;,&quot;bigmemory&quot;))%dopar%<br>\t{<br>\tfeature=strsplit(feature_name,&quot; &quot;)<br><br>\t#here we are simply putting the incorrect/total in user ability for feature<br>\ttotalRecords=mwhich(training,c(&quot;user_id&quot;,feature[[1]][1]),list(user,feature[[1]][2]),&quot;neq&quot;,&quot;AND&quot;)<br>\tcorrectRecords=mwhich(training,c(&quot;user_id&quot;,feature[[1]][1],&quot;outcome&quot;),list(user,feature[[1]][2],1),&quot;eq&quot;,&quot;AND&quot;)<br>\tif(length(correctRecords)&gt;0){<br>\t\tfeature_UserAbility[as.character(user),as.character(feature_name)]&lt;-length(correctRecords)/length(totalRecords)<br>\t}<br><br>\t}<br>x</pre>\r\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8262",
      "postDate": "01/25/2012 18:54:05",
      "content": "<p>I'm not familiar with Microsoft bugs since I run R on a linux machine. How much RAM and scrap do you have available? My current script runs on about 4gb of RAM, and reading previous forum questions, it looks like a common scenario. Have you tried setting\r\n up an EC2 machine?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "8264",
      "postDate": "01/25/2012 23:25:24",
      "content": "<p>I am using 4 gb ram. And i have assigned 2 out of four cores of my computer to registerdoSMP. I am not sure why error is coming. When ever i try to include packages as below the error starts coming. May be some syntax error in adding packages.</p>\r\n<pre class=\"x_prettyprint\">foreach(feature_name=feature_names[1:3],.packages=c(&quot;bigankalytics&quot;,&quot;bigmemory&quot;))%dopar% </pre>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 8214,
      "author_name": "mohit29765",
      "author_url": "",
      "post_date": "01/22/2012 04:47:30",
      "content": "<p>Also where can i get good forums on R , where i can discuss about R?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8219,
      "author_name": "biasvariance",
      "author_url": "",
      "post_date": "01/22/2012 19:30:36",
      "content": "<p>dopar is from the package &quot;foreach&quot; I don't see you having loaded it...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8253,
      "author_name": "podopie",
      "author_url": "",
      "post_date": "01/25/2012 00:58:24",
      "content": "<p>It may not help much, but Quick-R (http://www.statmethods.net/) Is a pretty great website to get familiar, err... &quot;quickly&quot; with what R has to offer.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8254,
      "author_name": "mohit29765",
      "author_url": "",
      "post_date": "01/25/2012 04:31:40",
      "content": "<p>Thanks podo for link, actually i had to reinstall R , then the issue i mentioned got resolved. Now i am facing more pronounced issue. I am using bigmemory fo handling large datasets and doSMP for parallelism. But when i try to execute foreach loop it hangs\r\n my computer and starts showingme microsoft errors. Do you anything about it?</p>\r\n<p>This is code i am trying to execute</p>\r\n<pre>x&lt;-foreach(user=users[1:2])%:%<br>foreach(feature_name=feature_names[1:3],.packages=c(&quot;bigankalytics&quot;,&quot;bigmemory&quot;))%dopar%<br>\t{<br>\tfeature=strsplit(feature_name,&quot; &quot;)<br><br>\t#here we are simply putting the incorrect/total in user ability for feature<br>\ttotalRecords=mwhich(training,c(&quot;user_id&quot;,feature[[1]][1]),list(user,feature[[1]][2]),&quot;neq&quot;,&quot;AND&quot;)<br>\tcorrectRecords=mwhich(training,c(&quot;user_id&quot;,feature[[1]][1],&quot;outcome&quot;),list(user,feature[[1]][2],1),&quot;eq&quot;,&quot;AND&quot;)<br>\tif(length(correctRecords)&gt;0){<br>\t\tfeature_UserAbility[as.character(user),as.character(feature_name)]&lt;-length(correctRecords)/length(totalRecords)<br>\t}<br><br>\t}<br>x</pre>\r\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8262,
      "author_name": "podopie",
      "author_url": "",
      "post_date": "01/25/2012 18:54:05",
      "content": "<p>I'm not familiar with Microsoft bugs since I run R on a linux machine. How much RAM and scrap do you have available? My current script runs on about 4gb of RAM, and reading previous forum questions, it looks like a common scenario. Have you tried setting\r\n up an EC2 machine?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 8264,
      "author_name": "mohit29765",
      "author_url": "",
      "post_date": "01/25/2012 23:25:24",
      "content": "<p>I am using 4 gb ram. And i have assigned 2 out of four cores of my computer to registerdoSMP. I am not sure why error is coming. When ever i try to include packages as below the error starts coming. May be some syntax error in adding packages.</p>\r\n<pre class=\"x_prettyprint\">foreach(feature_name=feature_names[1:3],.packages=c(&quot;bigankalytics&quot;,&quot;bigmemory&quot;))%dopar% </pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "8212": "",
    "8214": "",
    "8219": "",
    "8253": "",
    "8254": "",
    "8262": "",
    "8264": ""
  },
  "source": "meta"
}