- Learn to run RStudio on Maverick through the TACC Visualization Portal
- Import data
- Run R scripts
- Save results
- Visualize results
- Load R modules
R is a programming environment for statistical and data analysis computations. R is an open source GPL licensed (free to anyone) offspring of S, initially written by Ross Ihaka and Robert Gentleman at Dep. of Statistics of U of Auckland, New Zealand during 1990s. It continues to be in active development; http://www.r-project.org/
- Statistics and analysis
- Plotting and graphics
- Data handling and storage
- Scripting (loops, subroutines, etc)
Logging in
- Wait for authentification
- Will automatically switch to displaying Jobs tab
- Select Maverick
- Select a project that has an allocation on Maverick
- Select RStudio
Wait patiently. Move startup window up with mouse to make sure it did not fail.
Now open RStudio in your browser by clicking the button.
Congratulations!
- Use VNC. ssh. or git-bash and your basic linux knowledge to find your working directory path on maverick. Copy it.
- Make and save a tab delimited text data file with some random numbers as
data.txt
- Source Editor / Interactive Highlight & Run
- Data Viewer
- Interactive Console
- Workspace / Variable Viewer
- Session History
- File Management
- Plot Viewer
- Package Loader
- Interactive Help
In the interactive console type (using your own work directory):
workdir="/work/01234/jcarson/maverick"
setwd(workdir)
You could also instead use the File Management window on bottom right to set the working directory. Once it is set, read in the file.
x = read.delim(“filename.txt”)
How can you tell it has been read in?
Credit to: http://evomics.org/learning/programming/introduction-to-r/
Upper Left Window
- Tools
- Import Dataset
- From Web URL
Repeat for both datasets
- http://evomicsorg.wpengine.netdna-cdn.com/wp-content/uploads/2013/01/healthy_metadata.txt
- http://evomicsorg.wpengine.netdna-cdn.com/wp-content/uploads/2013/01/sick_metadata.txt
summary(healthy_metadata)
summary(sick_metadata)
boxplot(healthy_metadata$Age, sick_metadata$Age)
Try exporting your plot. Be sure to specify your working directory in the save window
You can use the GUI to save and load your workspace
- Session - save workspace
- Quit RStudio
- Reopen RStudio
- Session - load workspace
- Type
demo()
to see a list of demos available and try some of them out, e.g.demo(graphics)
- Find a favorite plot and save it as a pdf in your work directory
- Verify that the file is where you wanted to save it