FantasyFootballAnalytics / FantasyFootballAnalyticsR

R scripts and data files for the Fantasy Football Analytics website
http://fantasyfootballanalytics.net/
457 stars 1.58k forks source link

undefined columns in projections_fp #12

Closed Ariel225 closed 8 years ago

Ariel225 commented 9 years ago

Hi,

I'm new at commenting on GitHub, so forgive me if I'm not doing this right.

When I get to line 125:

#Order variables in data set
projections_fp <- projections_fp[,c(prefix, paste(varNames, suffix, sep="_"))]

I get the following error

Error in [.data.frame(projections_fp, , c(prefix, paste(varNames, suffix, : undefined columns selected

projections_fp [1] name player_fp.x passAtt_fp passComp_fp
[5] passYds_fp passTds_fp passInt_fp rushAtt_fp
[9] rushYds_fp rushTds_fp fumbles_fp pts_fp
[13] pos.x rec_fp recYds_fp recTds_fp
[17] fg_fp fga_fp xp_fp returnTds_fp
[21] twoPts_fp name_fp.x team_fp.x name_fp.y
[25] player_fp.y pos.y team_fp.y overallRank_fp [29] positionRank_fp

What's going on?

Thanks.

isaactpetersen commented 9 years ago

Hey Ariel,

Thanks for the comment. The scripts are currently out-of-date because we’ve been working on getting the tools ready for draft season. We have plans to update the scripts on the repo after we finish the tools. The error suggests that not all of the variables (varNames) are in the projections_fp object. I'd first make sure that all of those variables are in the data table (you may have to create blank columns for those projected stat categories that FantasyPros doesn't have).

Hope that helps, Isaac

isaactpetersen commented 8 years ago

This is fixed with our new ffanalytics R package: http://fantasyfootballanalytics.net/2016/06/ffanalytics-r-package-fantasy-football-data-analysis.html

Thanks! -Isaac