title: In R, It comes out as a number that tries to extract characters that match the condition using the ifelse syntax
body: <p>There are a total of 100 data from six teams' basketball games. I wrote the R code to see which team wins in each game like this. 
  <code>win = ifelse(dat$away_score &gt; dat$home_score, dat$away, dat$home)</code>
   However, the name of the basketball team is not output but is output as a number (1,2,3, ..). Of course, 
  After naming the basketball teams in alphabetical order, numbers were assigned according to their order. At this time, how do I print the results in the name of the original basketball team rather than numbers?</p>