text: user4595: I have a data frame
  Response TO CHEMOTHERAPY    Gene    CCF
  Responders                  POLQ    1
  Responders                 CDKN2A   1
  Responders                  TP53    1
  Responders              CCDC102B    0.906729075
  Non-responders           CCDC102B   1
  Non-responders           CCDC102B   1
  Non-responders           CCDC102B   1
  Non-responders             TSHZ3    1
  Non-responders             PIK3CA   1
  Responders                 SLIT2    1
  Non-responders              SLIT2   1
  
  I have two groups of patients; Responders to chemotherapy and non-responders. For each group I have calculated cancer cell faction (CCF) for a fixed set of genes so that an individual gene has several reads in each group
  If CCF = 1 the gene clonal and if CCF < 1 gene is sub clonal, for a given gene for each group, I therefore would have the number of clonal and sub clonal for this gene, for example 2 clonal 7 sub clonal which would be 2/7 something like the below heat map
  
  By your kindly code I produced this
  
  Which is not well informative
  This is another potential example heat map 
  
  Which show the clonal frequency for each group
  By the way thanks for your kindness 
  I don't know how to use dput() but this is my complete data
  https://www.dropbox.com/s/ol7m4nlkuyuy85a/c1.txt?dl=0
  
  user3541: Given the lack of effort from the OP, probably I shouldn't have wasted my time on this question with a lot of problems:
  i) The question is not reproducible, the OP should have supplied their data with dput().
  ii) The data as pasted above does not quite make sense to me, why would you have three readings from the same gene and even in such a case how should these replicates be represented in a heatmap?
  iii) The question is not specific enough and should not go like "how can I generate a heatmap" and should be more like "in an attempt to generate a heatmap like in this figure I have tried this piece of code but ..."
  Having said these, and after downvoting the question, here is a solution leveraging the ComplexHeatmap package:
  library(data.table)
  library(ComplexHeatmap)
  
  my_data <-
  "
  Sample  Gene    CCF
  Sample1 POLQ    1
  Sample1 CDKN2A  1
  Sample1 TP53    1
  Sample1 CCDC102B    0.906729075
  Sample1 CCDC102B    1
  Sample1 CCDC102B    1
  Sample1 CCDC102B    1
  Sample2 TSHZ3   1
  Sample2 PIK3CA  1
  Sample2 SLIT2   1
  Sample2 SLIT2   1
  "
  
  my_data <- fread(my_data)
  
  my_data <- dcast.data.table(my_data, 
                              formula = Gene ~ Sample,
                              value.var = "CCF",
                              fun=mean)
  
  # dcast generates NA values as the provided data does not have values for each gene
  my_data[is.na(my_data)] <- 0
  
  # Heatmap() expects a matrix input
  my_matrix <- as.matrix(my_data[,c("Sample1", "Sample2")])
  rownames(my_matrix) <- my_data$Gene
  
  Heatmap(my_matrix,
          cell_fun = function(j, i, x, y, width, height, fill) {
            grid.text(my_matrix[i, j], x, y, gp = gpar(fontsize = 10))})
  
  This is how the data look after dcast, in which multiple entries per gene (my point ii above) is summarized with mean():
  > head(my_matrix)
             Sample1 Sample2
  CCDC102B 0.9766823       0
  CDKN2A   1.0000000       0
  PIK3CA   0.0000000       1
  POLQ     1.0000000       0
  SLIT2    0.0000000       1
  TP53     1.0000000       0
  
  Here is the resulting heatmap:
  
  
original_text: 4595: <p>I have a data frame</p>
  
  <pre><code>Response TO CHEMOTHERAPY    Gene    CCF
  Responders                  POLQ    1
  Responders                 CDKN2A   1
  Responders                  TP53    1
  Responders              CCDC102B    0.906729075
  Non-responders           CCDC102B   1
  Non-responders           CCDC102B   1
  Non-responders           CCDC102B   1
  Non-responders             TSHZ3    1
  Non-responders             PIK3CA   1
  Responders                 SLIT2    1
  Non-responders              SLIT2   1
  </code></pre>
  
  <p>I have <code>two groups of patients</code>; <code>Responders to chemotherapy and non-responders</code>. For each group I have calculated <code>cancer cell faction (CCF)</code> for a fixed set of genes so that an individual gene has several reads in each group</p>
  
  <p>If <code>CCF = 1</code> the gene clonal and if CCF &lt; 1 gene is sub clonal, for a given gene for each group, I therefore would have the number of clonal and sub clonal for this gene, for example 2 clonal 7 sub clonal which would be 2/7 something like the below heat map</p>
  
  <p><a href="https://i.stack.imgur.com/6DzE8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6DzE8.png" alt="enter image description here"></a></p>
  
  <p>By your kindly code I produced this</p>
  
  <p><a href="https://i.stack.imgur.com/GW0pY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GW0pY.png" alt="enter image description here"></a></p>
  
  <p>Which is not well informative</p>
  
  <p>This is another potential example heat map </p>
  
  <p><a href="https://i.stack.imgur.com/HeabT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HeabT.png" alt="enter image description here"></a></p>
  
  <p>Which show the clonal frequency for each group</p>
  
  <p>By the way thanks for your kindness </p>
  
  <p>I don't know how to use <code>dput()</code> but this is my complete data</p>
  
  <p><a href="https://www.dropbox.com/s/ol7m4nlkuyuy85a/c1.txt?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/ol7m4nlkuyuy85a/c1.txt?dl=0</a></p>
   3541: <p>Given the lack of effort from the OP, probably I shouldn't have wasted my time on this question with a lot of problems:</p>
  
  <p>i) The question is not reproducible, the OP should have supplied their data with <code>dput()</code>.</p>
  
  <p>ii) The data as pasted above does not quite make sense to me, why would you have three readings from the same gene and even in such a case how should these replicates be represented in a heatmap?</p>
  
  <p>iii) The question is not specific enough and should not go like "how can I generate a heatmap" and should be more like "in an attempt to generate a heatmap like in this figure I have tried this piece of code but ..."</p>
  
  <p>Having said these, and after downvoting the question, here is a solution leveraging the <code>ComplexHeatmap</code> package:</p>
  
  <pre><code>library(data.table)
  library(ComplexHeatmap)
  
  my_data &lt;-
  "
  Sample  Gene    CCF
  Sample1 POLQ    1
  Sample1 CDKN2A  1
  Sample1 TP53    1
  Sample1 CCDC102B    0.906729075
  Sample1 CCDC102B    1
  Sample1 CCDC102B    1
  Sample1 CCDC102B    1
  Sample2 TSHZ3   1
  Sample2 PIK3CA  1
  Sample2 SLIT2   1
  Sample2 SLIT2   1
  "
  
  my_data &lt;- fread(my_data)
  
  my_data &lt;- dcast.data.table(my_data, 
                              formula = Gene ~ Sample,
                              value.var = "CCF",
                              fun=mean)
  
  # dcast generates NA values as the provided data does not have values for each gene
  my_data[is.na(my_data)] &lt;- 0
  
  # Heatmap() expects a matrix input
  my_matrix &lt;- as.matrix(my_data[,c("Sample1", "Sample2")])
  rownames(my_matrix) &lt;- my_data$Gene
  
  Heatmap(my_matrix,
          cell_fun = function(j, i, x, y, width, height, fill) {
            grid.text(my_matrix[i, j], x, y, gp = gpar(fontsize = 10))})
  </code></pre>
  
  <p>This is how the data look after <code>dcast</code>, in which multiple entries per gene (my point ii above) is summarized with <code>mean()</code>:</p>
  
  <pre><code>&gt; head(my_matrix)
             Sample1 Sample2
  CCDC102B 0.9766823       0
  CDKN2A   1.0000000       0
  PIK3CA   0.0000000       1
  POLQ     1.0000000       0
  SLIT2    0.0000000       1
  TP53     1.0000000       0
  </code></pre>
  
  <p>Here is the resulting heatmap:</p>
  
  <p><a href="https://i.stack.imgur.com/sMGAM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sMGAM.png" alt="enter image description here"></a></p>
  