Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tbl_df example is now broken for Lahman 3.0 #586

Closed
friendly opened this issue Sep 8, 2014 · 5 comments
Closed

tbl_df example is now broken for Lahman 3.0 #586

friendly opened this issue Sep 8, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@friendly
Copy link

@friendly friendly commented Sep 8, 2014

v 3.0-1 of the Lahman package entailed some changes in the names of ID variables:

  • HallOfFame$hofID is now HallOfFame$playerID
  • managerID is now playerID in all tables
  • Removed from Master: managerID, hofID, holtzID, lahmanID, lahman40ID, lahman45ID, nameNote, nameNick, and college

Consequently, when submitted to CRAN, the following error is generated when checking dplyr:

< > ### Name: tbl_df
< > ### Title: Create a data frame tble.
....
< > data("Master", "HallOfFame", package = "Lahman")
< > player_info <- select(tbl_df(Master), playerID, hofID, birthYear)
< Error in eval(expr, envir, enclos) : object 'hofID' not found
< Calls: select ... select_vars -> select_vars_q -> lapply -> FUN -> eval

The fix is to remove hofID from the call to select on line 53 of tbl_df.Rd

-Michael

@hadley hadley added the bug label Sep 11, 2014
@hadley hadley added this to the 0.3 milestone Sep 11, 2014
@hadley hadley self-assigned this Sep 11, 2014
@hadley
Copy link
Member

@hadley hadley commented Sep 11, 2014

I'm travelling at the moment, but I'll get fixed as soon as I can.

@hadley
Copy link
Member

@hadley hadley commented Sep 12, 2014

Removing that variable fixes the first problem, but then the joins won't work with the current lahman release :/

@friendly
Copy link
Author

@friendly friendly commented Sep 12, 2014

Well, we're in a package-version-clash situation here. The CRAN people rejected the new version, on R-Forge
because of the problem with dplyr, and my suggested fix won't work with the old version. I'll try asking the CRAN people to approve the new Lahman package as is, and then you can update dplyr, unless you have any other suggestion.

@friendly
Copy link
Author

@friendly friendly commented Sep 13, 2014

Lahman 3.0-1 is on CRAN now and should propagate shortly. Can you install the new version
and try the example again?
thx,

@djmurphy420
Copy link

@djmurphy420 djmurphy420 commented Sep 13, 2014

Two changes are needed:

(i) remove hofID in the call that produces player_info
(ii) in the next line, replace hofID with playerID.

When I made those two changes, all of the joins worked in the latest version of the Lahman package. I'm using version 0.2 of dplyr for this test. I tried to do the same with the development version of dplyr but it failed to install...that's a separate and tangential issue, though.

@hadley hadley closed this in 14c821b Sep 22, 2014
krlmlr pushed a commit to krlmlr/dplyr that referenced this issue Mar 2, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants