title: R: Import CSV with column names that contain spaces
body: <p>CSV file looks like this (modified for brevity). Several columns have spaces in their title and R can't seem to distinguish them.</p>
  
  <pre>
  Alias;Type;SerialNo;DateTime;Main status; [...]
  E1;E-70;781733;01/04/2010 11:28;8; [...]
  </pre>
  
  <p>Here is the code I am trying to execute:</p>
  
  <pre><code>s_data &lt;- read.csv2( file=f_name )
  attach(s_data)
  
  s_df = data.frame( 
                  scada_id=ID,
                  plant=PlantNo, 
                  date=DateTime,
                  main_code=Main status,
                  seco_code=Additional Status,
                  main_text=MainStatustext,
                  seco_test=AddStatustext,
                  duration=Duration)
  
  detach(s_data)
  </code></pre>
  
  <p>I have also tried substituting</p>
  
  <pre><code>main_code=Main\ status
  </code></pre>
  
  <p>and </p>
  
  <pre><code>main_code="Main status"
  </code></pre>