1

So I have this table football teams points by year

and I need to arrange it by team as rows and year (2010 - 2015) as attributes, so Ive tried with xtabs and table function, but I only get the count, instead of the points that the table contains.

Tried dcast(EvoTeam, club_name~newdate, value.var = "total") output

Although I define value.var as the score I am looking for, I still just get the frequency table. What am I doing wrong here?

kaezar22
  • 11
  • 2

1 Answers1

0

Since there could be more than one value for each year, I get the error message

-Aggregation function missing: defaulting to length-

so I have to tell R what to do, in this case, I use the mean, so in the code I write Evoteam.wide <- dcast(EvoTeam, club_name~newdate, value.var = 'total', mean)

It solved my problem

kaezar22
  • 11
  • 2