-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
per #6, use
#. file$decorator
syntax to refer to a decorator functi…
…on found in a separate file
- Loading branch information
nteetor
committed
Nov 27, 2016
1 parent
035adc6
commit 1e42a7a
Showing
5 changed files
with
58 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#. sample-utils$ramp_to(5) | ||
div_scale <- function() { | ||
cm.colors(3) | ||
} |
Empty file.
This file contains 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# A decorator which will ramp up a color scale, expects `f()` to return colors | ||
# to interpolate. | ||
ramp_to <- function(f, n) { | ||
function(...) { | ||
colorRampPalette(f(...))(n) | ||
} | ||
} | ||
|
||
as_double <- function(f) { | ||
function(...) { | ||
vapply(f(...), as.double, double(1)) | ||
} | ||
} |
This file contains 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