title: $ operator is invalid for atomic vectors for dataframe R
body: <p>I have the following code</p>
  
  <pre><code>tourneySeeds&lt;-read.csv("tourney_seeds.csv") 
  regSeason&lt;-read.csv("regular_season_compact_results.csv")
  playoff_teams &lt;- sort(tourneySeeds$team[which(tourneySeeds$season == "2013")])
  ...
  #Selecting the seeds for season A
  playoff_seeds &lt;- tourneySeeds[which(tourneySeeds$season == "2013"), ]
  seed_col &lt;- vector()
  BPI_col&lt;-vector()
  for(i in playoff_teams) {
    val &lt;- match(i, playoff_seeds$team)
    seed_col &lt;- c(seed_col, playoff_seeds$seed[val])
    BPI_col &lt;- c(BPI_col, playoff_seeds$BPI[val])
  }
  #team_seed &lt;- data.frame("Var1" = playoff_teams, "Freq" =seed_col)
  team_seed&lt;-data.frame()
  team_seed &lt;- cbind(playoff_teams, seed_col,BPI_col) 
  head(team_seed$seed_col)
  </code></pre>
  
  <p>where the <code>tourneySeeds</code> data frame looks like</p>
  
  <pre><code>season seed team BPI
  1980   W01  1207 5
  1980   W02  1210 8
  ...
  </code></pre>
  
  <p>However, for <code>head(team_seed$seed_col)</code> I get the message <code>Error in team_seed$seed_col : $ operator is invalid for atomic vectors</code></p>
  
  <p>why is this? I already set <code>team_seed</code> as a dataframe containing <code>seed_col</code></p>