-
Notifications
You must be signed in to change notification settings - Fork 317
Using R tool to generate simple rst tables
There is a package in R that could easily convert matrix data into reStructuredText simple table. https://www.rforge.net/doc/packages/knitr/kable.html. With the tool kable in R, you could easily read in a any data sheet (.csv, .txt, ASCII, etc.) into R, or create your own matrix data in R, use the command kable(dataname,format='rst',digit=2) , and then copy and paste the rst table in to your .rst file. There will be only slightly modifications for where you have inline math.
To use R on yellowstone or cheyenne, load R first (module load R), then type R. You could copy and paste R scripts at the interface just like using the interactive ncl. to exit R, type q(). You could run R at background use R CMD BATCH script.R, which will allow you to submit large R jobs to queue.
Here is a simple R script to read in CLM5 parameter file to get crop phenology parameters: /glade/u/home/yaqiong/rsttable/script1.R
Another script that read in an pre-generated .csv file : /glade/u/home/yaqiong/rsttable/script2.R
It will generate rst simple table text, copy and paste the text into .rst and modify the inline math to be correct, then you done.
-
General
-
Documents
-
Bugs/Issues
-
Tutorials
-
Development guides
CTSM Users:
CTSM Developer Team
-
Meetings
-
Notes
-
Editing documentation (tech note, user's guide)