title: How can I have R utilize more of the processing power on my PC?
body: <p>R version: 3.2.4</p>
  
  <p>RStudio version: 0.99.893</p>
  
  <p>Windows 7</p>
  
  <p>Intel i7</p>
  
  <p>480 GB RAM</p>
  
  <p><code>str(df)</code>
  <code>161976 obs. of 11 variables</code></p>
  
  <p>I am a relative novice to R and do not have a software programming background. My task is to perform clustering on a data set. </p>
  
  <p>The variables have been scaled and centered. I am using the following code to find the optimal number of clusters:</p>
  
  <p><code>d &lt;- dist(df, method = "euclidean")</code></p>
  
  <p><code>library(cluster)</code></p>
  
  <p><code>pamk.best &lt;- pamk(d)</code></p>
  
  <p><code>plot(pam(d, pamk.best$nc))</code></p>
  
  <p>I have noticed that the system never uses more than 22% of the CPU's processing power.</p>
  
  <p>I have taken the following actions so far:</p>
  
  <ol>
  <li>Unsuccessfully tried to change the <em>Set Priority</em> and <em>Set Affinity</em> setting for <code>rsession.exe</code> in the <strong>Processes</strong> tab of the <em>Windows Task Manager</em>. But, for some reason, it always comes back to low even when I set it to High or Realtime or anything else on that list. The <em>Set Affinity</em> setting shows that the system is allowing R to use all of the cores.</li>
  <li>I have adjusted the <code>High Performance</code> settings on my machine by going into <em>Control Panel</em> -> <em>Power Options</em> -> <em>Change advance power settings</em> -> <em>Processor Power Management</em> to 100%.</li>
  <li>I have read up the parallel processing <code>CRAN Task View for High Performance Computing</code>. I may be wrong but I don't think that calculating distance between observations in a data set is a task that should be parallelized, in the sense of, dividing up the data set in subsets and performing the distance calculations on subsets in parallel on different cores. Please correct me if I am wrong.</li>
  </ol>
  
  <p>One option I have is to perform clustering on a subset of the data set and then predict cluster membership for the rest of the data set. But, I am thinking that if I have the processing power and the memory available, why can't I perform the clustering on the whole data set!</p>
  
  <p>Is there a way to have the machine or <code>R</code> use higher percentage of the  processing power and complete the task quicker? </p>
  
  <p><strong>EDIT:</strong> I think that my issue is different from the one described in <em>Multithreading in R</em> because I am not trying to run different functions in R. Rather, I am running only one function on one dataset and would like the machine to use more processing power that is available to it.</p>