title: How to iterate over list of tables and find proportions in R
body: <p>I have a list of tables in R in which each table is a column from a larger dataset. These are tables instead of dataframes as I want to use prop.table to find the percentage of occurance for the data.</p>
  <p>I'm new to R so I have been manually finding the percentage one-by-one for each table. I am trying to make this a for loop instead but it doesn't seem to work. The loop is looping the correct number of times but it is giving me the results for the last table &quot;Actually_Malicious&quot; each time it opens a new View() table.</p>
  <pre><code>categorical_variables_list = list(Download_Source, 
                                    TLD, 
                                    Download_Speed, 
                                    Executable_Code_Maybe_Present_in_Headers,
                                    No_Executable_Code_Found_In_Headers,
                                    Evidence_of_Code_Obfuscation,
                                    Actually_Malicious)
  
  
  for(col in 1:length(categorical_variables_list)){
    
    tab &lt;- table(categorical_variables_list[[col]]); 
    View(tab);
    prop &lt;- prop.table(tab); 
    View(prop);
  }
  </code></pre>