You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.1 KiB

4 years ago
# The R Project for Statistical Computing
R is an open source programming language. It has become one of the powerful choices for statistical analysis. R helps you to get big picture of your data by calculating statistical parameters like mean, standard deviation, correlation etc.
[wikipedia.org/wiki/R_](https://en.wikipedia.org/wiki/R_(programming_language))
4 years ago
## LabInstance R
4 years ago
![alt text](images/swarmlab-network.png "")
## Quickstart
This is a quickstart guide of howto use this *LabInstance*
4 years ago
### HowTo use it
- On step "*1. Select Git Repo*" [see here](http://docs.swarmlab.io/SwarmLab-HowTos/HowTo-create-lab.adoc.html)
choose "*examples-r*"
- On step "*2. Select swarm service*" choose "*ondemand_r_master*"
- On step "*3. Save Lab Instance*" put the name you want
- Save it.
Your are ready to run your fresh *LabInstance* [see here](http://docs.swarmlab.io/SwarmLab-HowTos/HowTo-create-lab.adoc.html#_run_instance)
### Default Configuration
4 years ago
- Working Directory
> /root
- Default user
> root
4 years ago
- Buid-in Web Server
> /var/www/html/[Lab_Instance Name]
---
**INFO**
4 years ago
*Lab_Instance Name* = The name you give [here](http://docs.swarmlab.io/SwarmLab-HowTos/HowTo-create-lab.adoc.html#_step_3_save_lab_instance)
4 years ago
4 years ago
You can also find [here](http://docs.swarmlab.io/SwarmLab-HowTos/index.adoc.html#_main_lab_intance_interface)
Usage: See examples/PieChart.R
> e.g. png(file = "/var/www/html/examples_r/piechart.png")
4 years ago
---
4 years ago
4 years ago
- install R packages
4 years ago
Here is a simple code to install all the necessary R packages to keep you up and running. The script will check whether the required packages have been installed, if not, it will install them accordingly.
4 years ago
> install <- function(packages){
4 years ago
>
4 years ago
> new.packages <- packages[!(packages %in% installed.packages()[, "Package"])]
4 years ago
>
4 years ago
> if (length(new.packages))
4 years ago
>
4 years ago
> install.packages(new.packages, dependencies = TRUE)
4 years ago
>
4 years ago
> sapply(packages, require, character.only = TRUE)
4 years ago
>
4 years ago
> }
>
4 years ago
>
4 years ago
> required.packages <- c("package1", "package2" )
4 years ago
>
4 years ago
> install(required.packages)
4 years ago
---
**MORE INFO**
See swarmlab and examples directory
---
4 years ago