-
Notifications
You must be signed in to change notification settings - Fork 27
replaced plyr occurences with data.table #188
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
Closed
suhaani-agarwal
wants to merge
13
commits into
animint:master
from
suhaani-agarwal:remove-pylr-occurences
Closed
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1c8e8c1
replaced pylr occurences with data.table
suhaani-agarwal bfea5dc
removed dplyr from test-compiler-fortify.r
suhaani-agarwal 485e1f3
added requested changes
suhaani-agarwal 3e102a3
requested changes
suhaani-agarwal 8130a0a
made changes
suhaani-agarwal 0b18d0a
removed plyr from DESCRIPTION
suhaani-agarwal 32b7d5e
added test-renderer for newtonraphson method of root finding visualiz…
suhaani-agarwal 18a8e61
Refactored plyr occurrences
suhaani-agarwal 099092b
minor changes
suhaani-agarwal e75e0dc
resolved renderer error
suhaani-agarwal 0dfdc9e
added .(panel)
suhaani-agarwal 31b0d56
resolved some errors
suhaani-agarwal b78ce96
changed .BY[[1]]
suhaani-agarwal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,7 +74,6 @@ Imports: | |
| grid, | ||
| gtable (>= 0.1.1), | ||
| MASS, | ||
| plyr (>= 1.7.1), | ||
| reshape2, | ||
| scales (>= 0.4.1), | ||
| stats, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,33 @@ | ||
| library(data.table) | ||
| # Transform the data as the coordinate system does | ||
|
|
||
| cdata <- function(plot) { | ||
| pieces <- ggplot_build(plot) | ||
|
|
||
| lapply(pieces$data, function(d) { | ||
| plyr::ddply(d, "PANEL", function(panel_data) { | ||
| scales <- panel_scales(pieces$panel, panel_data$PANEL[1]) | ||
|
|
||
| # Process each piece of data while maintaining panel structure | ||
| result <- lapply(pieces$data, function(d) { | ||
| dt <- as.data.table(d) | ||
|
|
||
| # Explicitly group by PANEL and process each panel's data | ||
| dt[, { | ||
| current_panel <- .BY[[1]] # Get the current PANEL from grouping | ||
| scales <- panel_scales(pieces$panel, current_panel) | ||
| details <- plot$coordinates$train(scales) | ||
| plot$coordinates$transform(panel_data, details) | ||
| }) | ||
| as.data.table(plot$coordinates$transform(as.data.frame(.SD), details)) | ||
| }, by = PANEL] | ||
| }) | ||
|
|
||
| return(result) | ||
| } | ||
|
|
||
| pranges <- function(plot) { | ||
| panels <- ggplot_build(plot)$panel | ||
|
|
||
| x_ranges <- lapply(panels$x_scales, function(scale) scale$get_limits()) | ||
| y_ranges <- lapply(panels$y_scales, function(scale) scale$get_limits()) | ||
|
|
||
|
|
||
|
|
||
| npscales <- plot$scales$non_position_scales() | ||
| npranges <- lapply(npscales$scales$scales, function(scale) scale$get_limits()) | ||
|
|
||
|
|
||
| c(list(x = x_ranges, y = y_ranges), npranges) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.