title: Change the time zone only for certain rows in a column?
body: <p>I am working with data in R and would like to change the time zone of some POSIXct data, but only for certain rows within the columns (Survey_Start and Survey_End). Some of the data is already in the proper time zone, so converting the entire column is a problem. My code to change the time zone is:</p>
  <pre><code>    herps2021 &lt;- herps2021 %&gt;%
      mutate(Survey_Start = as.POSIXct(Survey_Start, format = &quot;%H:%M:%S&quot;, 
      tz = &quot;UTC&quot;),
       Survey_End = as.POSIXct(Survey_End, format = &quot;%H:%M:%S&quot;, tz = 
      &quot;UTC&quot;),
           
            #Change to proper time zone
           Survey_Start = with_tz(Survey_Start, tzone = &quot;America/Los_Angeles&quot;),
           Survey_End  = with_tz(Survey_End , tzone = &quot;America/Los_Angeles&quot;)
            )
  </code></pre>
  <p>Is there a way to specify which rows for the columns Survey_Start and Survey_End I want to convert, so that the data already in the correct time zone is unaffected?</p>
  <p>Thanks!</p>