title: How do I conduct a clustering analysis if my dataset is too large?
body: <p>I have the following dataset as seen beneath:</p>
  <pre><code>    data.frame':    42172 obs. of  3 variables:
   $ Product: Factor w/ 811 levels &quot;P1&quot;,&quot;P2&quot;,&quot;P3&quot;,..: 1 2 3 4 5 6 7 8 9 10 .. 
   $ Week   : Factor w/ 52 levels &quot;W1&quot;,&quot;W2&quot;,&quot;W3&quot;,..: 1 1 1 1 1 1 1 1 1 1 ...
   $ Sales  : int  11 7 7 12 8 3 4 8 14 22 ...
  </code></pre>
  <p>Subsequently, I pre-process my data and exclude the labels &quot;Product&quot; and &quot;Week&quot; from my data set to run clustering analyses:</p>
  <pre><code>df1_labels &lt;- df1[&quot;Product&quot;,&quot;Week&quot;]
   df1$Product &lt;- NULL
   df1$Week &lt;- NULL
   str(df1)
  'data.frame':   42172 obs. of  1 variable:
   $ Sales: int  11 7 7 12 8 3 4 8 14 22 ...
   sc_df &lt;- as.data.frame(scale(df1))
   summary(sc_df)
       Sales        
   Min.   :-0.7416  
   1st Qu.:-0.7416  
   Median :-0.4082  
   Mean   : 0.0000  
   3rd Qu.: 0.2584  
   Max.   : 5.3418 
  </code></pre>
  <p>Finally, when I attempt to compute and plot a cluster I under go the following Issue:</p>
  <pre><code>dist_df &lt;- dist(sc_df, method = 'euclidean')
  hclust_avg &lt;- hclust(dist_df, method = &quot;average&quot;)
  plot(hclust_avg)enter code here
  </code></pre>
  <p>Output:</p>
  <pre><code>Error: cannot allocate vector of size 6.6 Gb
  </code></pre>
  <p>Seemingly the dataset is to big, thus what would I need to do under such circumstances?</p>