Skip to content

Updated aes-calculated.r for pairlists #1155

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

Merged
merged 4 commits into from
Jul 23, 2015
Merged

Conversation

NikNakk
Copy link
Contributor

@NikNakk NikNakk commented Jul 3, 2015

Updated to correct code to handle formals of anonymous function and zero-length names. This fixes the issue just posted at #1154 and discussed on Stack Overflow at http://stackoverflow.com/questions/31212054/functions-inside-aes .

Updated to correct code to handle formals of anonymous function and zero-length names
expr_ch <- as.character(expr)
if (nchar(expr_ch) > 0) {
as.name(gsub(match_calculated_aes, "\\1", as.character(expr)))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please match style?

@hadley
Copy link
Member

hadley commented Jul 4, 2015

Thanks. Can you please add a unit test or two and a bullet to NEWS?

…onymous function s in `strip_dots`. Added bullet to NEWS.
@NikNakk
Copy link
Contributor Author

NikNakk commented Jul 4, 2015

I've added a unit test for a simple anonymous function to test-layer.r and a line to the bottom of the current NEWS. I've also shortened the line length of one of my updated lines by removing a redundant as.character. Was this the style issue or something else? I've looked through your style guide and can't find any other issues. In terms of line length, test-layer.r already has quite a few lines >60 characters and so I've not tried to shorten my lines to that length. Hope that's ok.

expr_ch <- as.character(expr)
if (nchar(expr_ch) > 0) {
as.name(gsub(match_calculated_aes, "\\1", expr_ch))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the style issue - } should be on the same line as else

@NikNakk
Copy link
Contributor Author

NikNakk commented Jul 4, 2015

Sorry, normally put } else {! Somehow managed to overlook that.

@hadley hadley merged commit 7e19f43 into tidyverse:master Jul 23, 2015
@hadley
Copy link
Member

hadley commented Jul 23, 2015

Thanks!

@lock
Copy link

lock bot commented Jan 18, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants