R Programming Language
This is my initial R Programming Language plug-in for GeSHi. Not much to it for now. But it does demonstrate the use of packages, and hot links on documentation for each language method.
Sample code
-
# source code reference: http://bayes.math.montana.edu/Rweb/Rweb.general.html
You can click on the highlighted methods, or copy the code above and paste it into a web version of R called RWeb
GeSHi file
Here I present my first draft of the R file for GeSHi
-
<?php
-
/*************************************************************************************
-
* r.php
-
* ———–
-
* Author: Ron Fredericks (ronf@LectureMaker.com)
-
* Copyright: (c) 2009 Ron Fredericks (http://www.LectureMaker.com)
-
* Release Version: 0.0.0.1
-
* Date Started: 2009/03/28
-
*
-
* R language file for GeSHi.
-
*
-
* CHANGES
-
* ——-
-
* 2009/03/29 (0.0.1)
-
* - First Internal Release
-
*
-
* 2009/04/06
-
* - Add references to Sekhon’s R Package docs
-
*
-
*
-
* References
-
* ———-
-
* Some online R Package documentation:
-
* http://sekhon.berkeley.edu/library/index.html 2.4 docs
-
* http://astrostatistics.psu.edu/su07/R/html 2.5 docs
-
*
-
* Another R GeSHi with no meat? http://organicdesign.co.nz/GeSHi/R.php
-
* SourceForge R discussion: http://sourceforge.net/tracker/?func=detail&aid=2276025&group_id=114997&atid=670234
-
*
-
*************************************************************************************
-
*
-
* This file is part of GeSHi.
-
*
-
* GeSHi is free software; you can redistribute it and/or modify
-
* it under the terms of the GNU General Public License as published by
-
* the Free Software Foundation; either version 2 of the License, or
-
* (at your option) any later version.
-
*
-
* GeSHi is distributed in the hope that it will be useful,
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
* GNU General Public License for more details.
-
*
-
* You should have received a copy of the GNU General Public License
-
* along with GeSHi; if not, write to the Free Software
-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
*
-
************************************************************************************/
-
-
‘LANG_NAME’ => ‘r’,
-
‘CASE_KEYWORDS’ => GESHI_CAPS_NO_CHANGE,
-
‘ESCAPE_CHAR’ => ”,
-
‘function’, ‘global’, ‘if’, ‘otherwise’, ‘persistent’, ‘return’,
-
‘switch’, ‘try’, ‘while’,‘…’
-
),
-
‘plot’,
-
‘abline’,
-
‘lines’,
-
‘hist’,
-
‘residuals’,
-
),
-
‘rnorm’,
-
),
-
‘lm’,
-
‘lowess’,
-
),
-
‘summary’,
-
),
-
‘exp’,
-
)
-
),
-
‘…’ , ‘(‘, ‘)’, ‘< -’, ‘~’
-
),
-
GESHI_COMMENTS => true,
-
1 => false,
-
2 => false,
-
//3 => false,
-
//4 => false,
-
),
-
1 => ‘color: #0000FF;’,
-
2 => ‘color: #0000FF;’,
-
3 => ‘color: #0000FF;’,
-
4 => ‘color: #0000FF;’,
-
5 => ‘color: #0000FF;’,
-
6 => ‘color: #0000FF;’
-
),
-
1 => ‘color: #228B22;’,
-
),
-
0 => ”
-
),
-
0 => ‘color: #080;’
-
),
-
//0 => ‘color: #A020F0;’
-
),
-
0 => ‘color: #ff0000;’
-
),
-
1 => ”,
-
2 => ”
-
),
-
0 => ‘color: #080;’
-
),
-
0 => ‘color:#A020F0;’
-
),
-
0 => ”
-
)
-
),
-
1 => ”,
-
2 => ‘http://astrostatistics.psu.edu/su07/R/html/graphics/html/{FNAME}.html’, // http://sekhon.berkeley.edu/library/graphics/html/{FNAME}.html
-
3 => ‘http://astrostatistics.psu.edu/su07/R/html/stats/html/Normal.html’, // http://sekhon.berkeley.edu/library/stats/html/Normal.html
-
4 => ‘http://astrostatistics.psu.edu/su07/R/html/stats/html/{FNAME}.html’, // http://sekhon.berkeley.edu/library/stats/html/{FNAME}.html
-
5 => ‘http://astrostatistics.psu.edu/su07/R/html/stats/html/summary.lm.html’, // http://sekhon.berkeley.edu/library/stats/html/summary.lm.html
-
6 => ‘http://astrostatistics.psu.edu/su07/R/html/base/html/Log.html’ // http://sekhon.berkeley.edu/library/base/html/Log.html
-
),
-
‘OOLANG’ => true,
-
1 => ‘.’,
-
2 => ‘::’
-
),
-
GESHI_SEARCH => "([^\w])’([^\\n\\r']*)’",
-
GESHI_REPLACE => ‘\\2′,
-
GESHI_MODIFIERS => ”,
-
GESHI_BEFORE => "\\1′",
-
GESHI_AFTER => "’"
-
)
-
),
-
‘STRICT_MODE_APPLIES’ => GESHI_NEVER,
-
),
-
)
-
);
-
-
?>
April 4th, 2009 at 6:17 pm
Viewers can learn more about the R language from my online video posted to LectureMaker.com:
http://www.lecturemaker.com/2009/02/r-kickoff-video/