title: String manipulation in R to create dataframe column
body: <p>I have  an R dataframe(df) which includes a factor column, Team</p>
  
  <pre><code>Team
  Baltimore Orioles
  Kansas City Chiefs
  ...
  </code></pre>
  
  <p>I just want to create a new column, nickname, which just refers to the last name</p>
  
  <pre><code>Nickname
  Orioles
  Chiefs
  </code></pre>
  
  <p>As a first stage, I have tried splitting the factor like this</p>
  
  <pre><code>df$Nickname &lt;- strsplit(as.character(df$Team), " ")
  </code></pre>
  
  <p>which produces a list of character fields which I  can reference thus</p>
  
  <pre><code>&gt;df$Nickname[1]
  
  [[1]]
  [1] "Baltimore" "Orioles"
  </code></pre>
  
  <p>and </p>
  
  <pre><code>&gt;str(df$Nickname[1])
  
  List of 1
   $ : chr [1:2] "Baltimore" "Orioles"
  </code></pre>
  
  <p>but then I do not know how to proceed. Trying to get the length</p>
  
  <blockquote>
    <p>length(df$Nickname[1])</p>
  </blockquote>
  
  <p>gives 1 - which flummoxes me</p>