User:AnatolV/Helper Functions: Difference between revisions

Content added Content deleted
(adding gnuplot sample, editing)
m (just minor edit)
Line 2: Line 2:
;Note:
;Note:
* Good helper function usually encapsulates typical set of actions for current tasks, supplies often used default values, interacting with other helper functions, etc.
* Good helper function usually encapsulates typical set of actions for current tasks, supplies often used default values, interacting with other helper functions, etc.
* Many samples of using presented functions can be found here on RC.<br><br>
* Many samples of using presented functions can be found here on RC.
* Many of these functions are already here on RC. But some of them are upgraded. So, this is the place to get latest versions.
<br><br>
=R Helper Functions=
=R Helper Functions=
One of the R's great powers is its unlimited number of great and good packages, virtually thousands of them. For any applications big or small you can find a package.<br>
One of the R's great powers is its unlimited number of great and good packages, virtually thousands of them. For any applications big or small you can find a package.<br>
Line 101: Line 103:
function pmat01(mat, color) {
function pmat01(mat, color) {
// DCLs
// DCLs
var cvs = document.getElementById('canvId');
var cvs = document.getElementById('cvsId');
var ctx = cvs.getContext("2d");
var ctx = cvs.getContext("2d");
var w = cvs.width; var h = cvs.height;
var w = cvs.width; var h = cvs.height;
Line 121: Line 123:
Not to mention bad color support and scaling.<br>
Not to mention bad color support and scaling.<br>
In addition, there are no built-in string manipulation functions, except of concatenation.<br>
In addition, there are no built-in string manipulation functions, except of concatenation.<br>
So, presented here helper functions help to fix some of these shortcomings. At the same time, they simplify
So, presented here helper functions help to fix some of these shortcomings. At the same time, they simplify some often used common actions.
==Plotting Helper Functions==
==Plotting Helper Functions==
Functions presented here are directly or inderectly related to plotting.
Many of these functions are already here on RC.
<lang parigp>
<lang parigp>
\\ 2 old plotting helper functions 3/2/16
\\ 2 old plotting helper functions 3/2/16
Line 205: Line 207:
</lang>
</lang>
==String Functions==
==String Functions==
The first 4 are already here on RC. A few others I will keep on hold (hoping to create a tasks later).
The first 4 are already here on RC. A few others I will keep on hold (hoping to create tasks later).


<lang parigp>
<lang parigp>